login
A378032
a(1) = a(2) = 1; a(n>2) is the greatest nonsquarefree number < prime(n).
29
1, 1, 4, 4, 9, 12, 16, 18, 20, 28, 28, 36, 40, 40, 45, 52, 56, 60, 64, 68, 72, 76, 81, 88, 96, 100, 100, 104, 108, 112, 126, 128, 136, 136, 148, 150, 156, 162, 164, 172, 176, 180, 189, 192, 196, 198, 208, 220, 225, 228, 232, 236, 240, 250, 256, 261, 268, 270
OFFSET
1,3
LINKS
FORMULA
a(n) = A378033(prime(n)).
EXAMPLE
The terms together with their prime indices begin:
1: {}
1: {}
4: {1,1}
4: {1,1}
9: {2,2}
12: {1,1,2}
16: {1,1,1,1}
18: {1,2,2}
20: {1,1,3}
28: {1,1,4}
28: {1,1,4}
36: {1,1,2,2}
40: {1,1,1,3}
40: {1,1,1,3}
45: {2,2,3}
52: {1,1,6}
56: {1,1,1,4}
60: {1,1,2,3}
64: {1,1,1,1,1,1}
68: {1,1,7}
72: {1,1,1,2,2}
MAPLE
R:= 1, 1: q:= 3: r:= 1:
for i from 3 to 100 do
p:= q; q:= nextprime(p);
for x from q-1 to p by -1 do
if not numtheory:-issqrfree(x) then r:=x; found:= true; break fi;
od;
R:= R, r;
od:
R; # Robert Israel, Nov 16 2025
MATHEMATICA
Table[NestWhile[#-1&, Prime[n], #>1&&SquareFreeQ[#]&], {n, 100}]
CROSSREFS
Terms appearing twice are A061351 + 1.
For prime-powers we have A065514 (diffs A377781), opposite A345531 (diffs A377703).
For squarefree we have A112925 (differences A378038).
The opposite for squarefree is A112926 (differences A378037).
The opposite is A377783 (union A378040), restriction of A120327 (differences A378039).
Restriction of A378033, which has differences A378036.
The first-differences are A378034, opposite A377784.
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers.
A013929 lists the nonsquarefree numbers, differences A078147, seconds A376593.
A061398 counts squarefree numbers between primes (sums A337030), zeros A068360.
A061399 counts nonsquarefree numbers between primes (sums A378086), zeros A068361.
A070321 gives the greatest squarefree number up to n.
A377046 encodes k-differences of nonsquarefree numbers, zeros A377050.
Sequence in context: A222045 A394184 A088190 * A092322 A341678 A050218
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 16 2024
STATUS
approved