login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Difference between n and the greatest prime power <= n, allowing 1.
5

%I #9 Dec 02 2024 18:11:16

%S 0,0,0,0,0,1,0,0,0,1,0,1,0,1,2,0,0,1,0,1,2,3,0,1,0,1,0,1,0,1,0,0,1,2,

%T 3,4,0,1,2,3,0,1,0,1,2,3,0,1,0,1,2,3,0,1,2,3,4,5,0,1,0,1,2,0,1,2,0,1,

%U 2,3,0,1,0,1,2,3,4,5,0,1,0,1,0,1,2,3,4

%N Difference between n and the greatest prime power <= n, allowing 1.

%C Prime powers allowing 1 are listed by A000961.

%F a(n) = n - A031218(n).

%F a(n) = A276781(n) - 1.

%e The greatest prime power <= 6 is 5, so a(6) = 1.

%t Table[n-NestWhile[#-1&,n,#>1&&!PrimePowerQ[#]&],{n,100}]

%Y Sequences obtained by subtracting each term from n are placed in parentheses below.

%Y For nonprime we have A010051 (almost) (A179278).

%Y Subtracting from n gives (A031218).

%Y For prime we have A064722 (A007917).

%Y For perfect power we have A069584 (A081676).

%Y For squarefree we have (A070321).

%Y Adding one gives A276781.

%Y For nonsquarefree we have (A378033).

%Y For non perfect power we have (A378363).

%Y For non prime power we have A378366 (A378367).

%Y The opposite is A378370 = A377282-1.

%Y A000015 gives the least prime power >= n.

%Y A000040 lists the primes, differences A001223.

%Y A000961 and A246655 list the prime powers, differences A057820.

%Y A024619 and A361102 list the non prime powers, differences A375708 and A375735.

%Y A151800 gives the least prime > n, weak version A007918.

%Y Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

%Y Cf. A001597, A007920, A013632, A065514, A074984, A377051, A377054, A377281, A377289, A377468, A378357, A378371.

%K nonn,new

%O 1,15

%A _Gus Wiseman_, Nov 29 2024