cp's OEIS Frontend

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.

A278455 Smallest prime that takes n steps to get to 1, each step reducing the prime by the largest power of 2 possible, with the resultant number a prime.

This page as a plain text file.
%I A278455 #19 Sep 08 2022 08:46:18
%S A278455 3,7,23,61,317,829,274973,1844867,29363357,275684009603,
%T A278455 2252075497694851,1155173580104541827,155838096186773789746819,
%U A278455 649037426474450432457432557949469,348449144376078413060946030467563206480413
%N A278455 Smallest prime that takes n steps to get to 1, each step reducing the prime by the largest power of 2 possible, with the resultant number a prime.
%H A278455 Jon E. Schoenfield, <a href="/A278455/b278455.txt">Table of n, a(n) for n = 1..18</a>
%e A278455 61 is the smallest prime with 4 steps: 61 (-32) -> 29 (-16) -> 13 (-8) -> 5 (-4) -> 1.
%e A278455 23 is the smallest prime with 3 steps: 23 -> 7 -> 3 -> 1
%t A278455 First /@ DeleteDuplicatesBy[#, Last] &@ Map[{First@ #, Length@ # - 1} &, DeleteCases[Map[NestWhileList[# - 2^Floor@ Log2@ # &, #, # > 1 &] &, Prime@ Range[2, 200000]], w_ /; Times @@ Boole[PrimeQ /@ Most@ w] != 1]] (* _Michael De Vlieger_, Nov 22 2016 *)
%o A278455 (Magma)
%o A278455 a:=[]; A:=[<1,0>]; /* A[j] is a pair: (A278454(j-1) & its no. of steps) */ maxSteps:=0; for d in [1..60] do for j in [1..#A] do t:=2^d+A[j][1]; if IsPrime(t) then A[#A+1]:=<t,A[j][2]+1>; if A[#A][2] gt maxSteps then maxSteps:=A[#A][2]; a[#a+1]:=A[#A][1]; end if; end if; end for; end for; a; //_Jon E. Schoenfield_, Nov 23 2016
%Y A278455 Cf. A278454.
%K A278455 nonn,base
%O A278455 1,1
%A A278455 _Randy L. Ekl_, Nov 22 2016
%E A278455 a(10)-a(15) from _Jon E. Schoenfield_, Nov 22 2016