OFFSET
1,1
COMMENTS
No term appears more than twice. Proof: This would require at least 4 consecutive squarefree numbers (3 primes and at least 1 squarefree number between them). But we cannot have more than 3 consecutive squarefree numbers, because otherwise one of them must be divisible by 4, hence not squarefree.
FORMULA
a(n) = A120327(prime(n)).
EXAMPLE
The third prime is 5, which is followed by 6, 7, 8, 9, ..., of which 8 is the first nonsquarefree term, so a(3) = 8.
The terms together with their prime indices begin:
4: {1,1}
4: {1,1}
8: {1,1,1}
8: {1,1,1}
12: {1,1,2}
16: {1,1,1,1}
18: {1,2,2}
20: {1,1,3}
24: {1,1,1,2}
32: {1,1,1,1,1}
32: {1,1,1,1,1}
40: {1,1,1,3}
44: {1,1,5}
44: {1,1,5}
48: {1,1,1,1,2}
54: {1,2,2,2}
60: {1,1,2,3}
63: {2,2,4}
68: {1,1,7}
72: {1,1,1,2,2}
MATHEMATICA
Table[NestWhile[#+1&, Prime[n], SquareFreeQ], {n, 100}]
CROSSREFS
For prime-power instead of nonsquarefree (and primes + 1) we have A345531.
First differences are A377784.
The union is A378040.
Terms appearing only once are A378082.
Terms appearing twice are A378083.
Nonsquarefree numbers that are missing are A378084.
A005117 lists the squarefree numbers.
A070321 gives the greatest squarefree number up to n.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 16 2024
EXTENSIONS
Proof suggested by Amiram Eldar.
STATUS
approved