A358089 First differences of A126706.
6, 2, 4, 4, 8, 4, 4, 1, 3, 2, 2, 2, 2, 4, 3, 5, 4, 3, 1, 4, 4, 4, 2, 2, 4, 2, 1, 1, 4, 4, 4, 4, 1, 3, 4, 2, 6, 3, 1, 4, 4, 3, 1, 2, 2, 1, 3, 4, 2, 2, 4, 3, 1, 3, 1, 4, 4, 4, 1, 3, 4, 2, 2, 4, 3, 1, 4, 4, 4, 4, 1, 3, 4, 2, 2, 4, 2, 2, 1, 3, 2, 2, 8, 1, 3, 4, 2
Offset: 1
Examples
The smallest numbers that are neither squarefree nor a prime power are {12, 18, 20, 24, 28 ...}, therefore the first terms of this sequence are {6, 2, 4, 4, ...}.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
k = 0; Rest@ Reap[Do[If[And[#2 > 1, #1 != #2] & @@ {PrimeOmega[n], PrimeNu[n]}, Sow[n - k]; Set[k, n] ],{n, 270}] ][[-1, -1]] (* Generate 317359 terms of this sequence from the image at A355447: *) Differences@ Position[Flatten@ ImageData[Import["https://oeis.org/A355447/a355447_1.png", "PNG"]], 0.][[All, -1]]
-
Python
from math import isqrt from sympy import primepi, integer_nthroot, mobius def A358089(n): def f(x): return int(n+sum(primepi(integer_nthroot(x,k)[0]) for k in range(2,x.bit_length()))+sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))) m, k = n, f(n) while m != k: m, k = k, f(k) r, k = n+1, f(n+1)+1 while r != k: r, k = k, f(k)+1 return r-m # Chai Wah Wu, Aug 15 2024
Comments