This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A275968 #21 May 22 2025 10:21:44 %S A275968 173,409,419,421,439,487,521,557,571,617,761,887,919,1009,1039,1117, %T A275968 1153,1171,1217,1327,1373,1549,1559,1571,1657,1693,1709,1721,1733, %U A275968 1783,1831,1861,1901,1993,1997,2053,2089,2339,2393,2521,2539,2647,2657,2677,2693,2777 %N A275968 Smaller of two consecutive primes p and q such that c(p) = c(q), where c(n) = A008908(n) is the length of x, f(x), f(f(x)), ... , 1 in the Collatz conjecture. %C A275968 If x is even f(x) = x/2 else f(x) = 3x + 1. %H A275968 Abhiram R Devesh, <a href="/A275968/b275968.txt">Table of n, a(n) for n = 1..10000</a> %e A275968 a(1) = p = 173; q = 179 %e A275968 c(p) = c(q) = 32 %t A275968 t = Table[Length@ NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # != 1 &] - 1, {n, 10^4}]; Prime@ Flatten@ Position[#, k_ /; Length@ k == 1] &@ Map[Union@ Part[t, #] &, #] &@ Partition[#, 2, 1] &@ Prime@ Range@ 410 (* _Michael De Vlieger_, Sep 01 2016 *) %o A275968 (PARI) A008908(n)=my(c=1); while(n>1, n=if(n%2, 3*n+1, n/2); c++); c %o A275968 t=A008908(p=2); forprime(q=3,1e4, tt=A008908(q); if(t==tt, print1(p", ")); p=q; t=tt) \\ _Charles R Greathouse IV_, Sep 01 2016 %o A275968 (Python) %o A275968 import sympy %o A275968 def lcs(n): %o A275968 a=1 %o A275968 while n>1: %o A275968 if n%2==0: %o A275968 n=n//2 %o A275968 else: %o A275968 n=(3*n)+1 %o A275968 a=a+1 %o A275968 return(a) %o A275968 m=2 %o A275968 while m>0: %o A275968 n=sympy.nextprime(m) %o A275968 if lcs(m)==lcs(n): %o A275968 print(m,) %o A275968 m=n %o A275968 # _Abhiram R Devesh_, Sep 02 2016 %Y A275968 Cf. A006577 (Collatz trajectory lengths), A078417, A008908. %K A275968 nonn,easy %O A275968 1,1 %A A275968 _Abhiram R Devesh_, Aug 15 2016