|
|
A280408
|
|
Irregular triangle read by rows listing the prime numbers that appear from the trajectory of n in Collatz Problem.
|
|
3
|
|
|
2, 2, 3, 5, 2, 2, 5, 2, 3, 5, 2, 7, 11, 17, 13, 5, 2, 2, 7, 11, 17, 13, 5, 2, 5, 2, 11, 17, 13, 5, 2, 3, 5, 2, 13, 5, 2, 7, 11, 17, 13, 5, 2, 23, 53, 5, 2, 2, 17, 13, 5, 2, 7, 11, 17, 13, 5, 2, 19, 29, 11, 17, 13, 5, 2, 5, 2, 2, 11, 17, 13, 5, 2, 23, 53, 5, 2, 3, 5, 2, 19, 29, 11, 17, 13, 5, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
The irregular array a(n,k) starts:
n\k 1 2 3 4 5 6
...
1: 2
2: 2
3: 3 5 2
4: 2
5: 5 2
6: 3 5 2
7: 7 11 17 13 5 2
8: 2
9: 7 11 17 13 5 2
10: 5 2
11: 11 17 13 5 2
12: 3 5 2
13: 13 5 2
14: 7 11 17 13 5 2
15: 23 53 5 2
|
|
MATHEMATICA
|
Table[Select[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # > 1 &], PrimeQ], {n, 2, 30}] // Flatten (* Michael De Vlieger, Jan 02 2017 *)
|
|
PROG
|
(Python)
from sympy import isprime
def a(n):
if n==1: return [2]
l=[n, ]
while True:
if n%2==0: n/=2
else: n = 3*n + 1
l+=[n, ]
if n<2: break
return list(filter(lambda i: isprime(i), l))
|
|
CROSSREFS
|
|
|
KEYWORD
|
tabf,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|