A319227 a(n) is the number of twin primes in the Collatz trajectory of n.
0, 0, 1, 0, 0, 1, 2, 0, 2, 0, 1, 1, 0, 2, 0, 0, 0, 2, 2, 0, 0, 1, 0, 1, 2, 0, 0, 2, 1, 0, 0, 0, 2, 0, 0, 2, 2, 2, 2, 0, 0, 0, 2, 1, 0, 0, 0, 1, 2, 2, 1, 0, 0, 0, 0, 2, 2, 1, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 2, 1, 2, 0, 2, 1, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2
Offset: 1
Keywords
Examples
a(7) = 2 because the Collatz trajectory of 7 is 7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 with two twin primes: (5, 7) and (11, 13).
Programs
-
Maple
nn:=10^8: for n from 1 to 100 do: m:=n:lst:={}: for i from 1 to nn while(m<>1) do: if irem(m, 2)=0 then m:=m/2: else lst:=lst union {m}:m:=3*m+1: fi: od: n0:=nops(lst):it:=0: for j from 1 to n0-1 do: if isprime(lst[j]) and isprime(lst[j+1]) and lst[j+1]=lst[j]+2 then it:=it+1:else fi: od: printf(`%d, `,it): od:
Comments