Ruth-Aaron numbers: Difference between revisions
Content added Content deleted
(→{{header|Perl}}: prepend pascal solution) |
(J) |
||
Line 32: | Line 32: | ||
;*[[oeis:A006145|OEIS:A006145 - Ruth-Aaron numbers (1): sum of prime divisors of n = sum of prime divisors of n+1]] |
;*[[oeis:A006145|OEIS:A006145 - Ruth-Aaron numbers (1): sum of prime divisors of n = sum of prime divisors of n+1]] |
||
;*[[oeis:A039752|OEIS:A039752 - Ruth-Aaron numbers (2): sum of prime divisors of n = sum of prime divisors of n+1 (both taken with multiplicity)]] |
;*[[oeis:A039752|OEIS:A039752 - Ruth-Aaron numbers (2): sum of prime divisors of n = sum of prime divisors of n+1 (both taken with multiplicity)]] |
||
=={{header|J}}== |
|||
Currently, the task asks for Ruth-Aaron numbers, rather than Ruth-Aaron groups. |
|||
Thus: |
|||
<lang J> NB. using factors |
|||
30{.1 2+/~I. 2 =/\ +/@q: 1+i.100000 |
|||
5 6 |
|||
8 9 |
|||
15 16 |
|||
77 78 |
|||
125 126 |
|||
714 715 |
|||
948 949 |
|||
1330 1331 |
|||
1520 1521 |
|||
1862 1863 |
|||
2491 2492 |
|||
3248 3249 |
|||
4185 4186 |
|||
4191 4192 |
|||
5405 5406 |
|||
5560 5561 |
|||
5959 5960 |
|||
6867 6868 |
|||
8280 8281 |
|||
8463 8464 |
|||
10647 10648 |
|||
12351 12352 |
|||
14587 14588 |
|||
16932 16933 |
|||
17080 17081 |
|||
18490 18491 |
|||
20450 20451 |
|||
24895 24896 |
|||
26642 26643 |
|||
26649 26650 |
|||
NB. using divisors |
|||
30{.1 2+/~I. 2 =/\ (+/@{.@q:~&__) 1+i.100000 |
|||
5 6 |
|||
24 25 |
|||
49 50 |
|||
77 78 |
|||
104 105 |
|||
153 154 |
|||
369 370 |
|||
492 493 |
|||
714 715 |
|||
1682 1683 |
|||
2107 2108 |
|||
2299 2300 |
|||
2600 2601 |
|||
2783 2784 |
|||
5405 5406 |
|||
6556 6557 |
|||
6811 6812 |
|||
8855 8856 |
|||
9800 9801 |
|||
12726 12727 |
|||
13775 13776 |
|||
18655 18656 |
|||
21183 21184 |
|||
24024 24025 |
|||
24432 24433 |
|||
24880 24881 |
|||
25839 25840 |
|||
26642 26643 |
|||
35456 35457 |
|||
40081 40082</lang> |
|||
=={{header|Julia}}== |
=={{header|Julia}}== |