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”).

A377783
Least nonsquarefree number > prime(n).
23
4, 4, 8, 8, 12, 16, 18, 20, 24, 32, 32, 40, 44, 44, 48, 54, 60, 63, 68, 72, 75, 80, 84, 90, 98, 104, 104, 108, 112, 116, 128, 132, 140, 140, 150, 152, 160, 164, 168, 175, 180, 184, 192, 196, 198, 200, 212, 224, 228, 232, 234, 240, 242, 252, 260, 264, 270, 272
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 squarefree we have A112926 (diffs A378037), opposite A112925 (diffs A378038).
Restriction to the primes of A120327, which has first differences A378039.
For prime-power instead of nonsquarefree (and primes + 1) we have A345531.
First differences are A377784.
The opposite is A378032 (diffs A378034), restriction of A378033 (diffs A378036).
The union is A378040.
Terms appearing only once are A378082.
Terms appearing twice are A378083.
Nonsquarefree numbers that are missing are A378084.
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, zeros A068360.
A061399 counts nonsquarefree numbers between primes, zeros A068361.
A070321 gives the greatest squarefree number up to n.
Sequence in context: A168273 A278933 A351838 * A328527 A378249 A145447
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 16 2024
EXTENSIONS
Proof suggested by Amiram Eldar.
STATUS
approved