cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 70 results. Next

A053797 Lengths of successive gaps between squarefree numbers.

Original entry on oeis.org

1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 3, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 2, 3, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 3, 1, 3, 1, 2, 2, 2, 1
Offset: 1

Views

Author

N. J. A. Sloane, Apr 07 2000

Keywords

Comments

From Gus Wiseman, Jun 11 2024: (Start)
Also the length of the n-th maximal run of nonsquarefree numbers. These runs begin:
4
8 9
12
16
18
20
24 25
27 28
32
36
40
44 45
48 49 50
(End)

Examples

			The first gap is at 4 and has length 1; the next starts at 8 and has length 2 (since neither 8 nor 9 are squarefree).
		

Crossrefs

Gaps between terms of A005117.
For squarefree runs we have A120992, antiruns A373127 (firsts A373128).
For composite runs we have A176246 (rest of A046933), antiruns A373403.
For prime runs we have A251092 (rest of A175632), antiruns A027833.
Position of first appearance of n is A373199(n).
For antiruns instead of runs we have A373409.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.

Programs

  • Maple
    SF:= select(numtheory:-issqrfree,[$1..1000]):
    map(`-`,select(`>`,SF[2..-1]-SF[1..-2],1),1); # Robert Israel, Sep 22 2015
  • Mathematica
    ReplaceAll[Differences[Select[Range@384, SquareFreeQ]] - 1, 0 -> Nothing] (* Michael De Vlieger, Sep 22 2015 *)

Extensions

Offset set to 1 by Peter Kagey, Sep 29 2015

A120992 Number of integers in n-th run of squarefree positive integers.

Original entry on oeis.org

3, 3, 2, 3, 1, 1, 3, 1, 3, 3, 3, 3, 2, 1, 1, 1, 3, 2, 3, 3, 2, 3, 2, 3, 1, 1, 3, 1, 3, 3, 3, 3, 2, 2, 1, 3, 2, 3, 3, 2, 1, 1, 2, 3, 1, 1, 3, 1, 2, 3, 3, 3, 2, 3, 1, 1, 3, 2, 3, 3, 3, 3, 2, 3, 1, 1, 3, 1, 2, 1, 1, 3, 3, 2, 3, 1, 1, 2, 2, 3, 3, 2, 1, 1, 2, 3, 1
Offset: 1

Views

Author

Leroy Quet, Jul 21 2006

Keywords

Comments

The values 1, 2 and 3 occur 309008, 251134 and 439858 times, respectively, in the first 1000000 terms. - Rick L. Shepherd, Jul 25 2006
From Reinhard Zumkeller, Jan 20 2008: (Start)
1 <= a(n) <= 3.
A136742(n) = Product{k=0..a(n)} (A072284(n)+k).
A136743(n) = Sum_{k=0..a(n)} A001221(A072284(n)+k).
(End)
Also the lengths of runs in A243348, differences of the n-th squarefree number and n. - Antti Karttunen, Jun 06 2014

Examples

			The runs of squarefree integers are as follows: (1,2,3), (5,6,7), (10,11), (13,14,15), (17), (19), (21,22,23),...
		

Crossrefs

Programs

  • Maple
    with(numtheory): a:=proc(n) if mobius(n)=0 then n else fi end: A:=[0,seq(a(n),n=1..500)]: b:=proc(n) if A[n]-A[n-1]>1 then A[n]-A[n-1]-1 else fi end: seq(b(n),n=2..nops(A)); # Emeric Deutsch, Jul 24 2006
  • Mathematica
    t = {}; cnt = 0; Do[If[SquareFreeQ[n], cnt++, If[cnt > 0, AppendTo[t, cnt]; cnt = 0]], {n, 500}]; t (* T. D. Noe, Mar 19 2013 *)
  • PARI
    n=1; while(n<1000, c=0; while(issquarefree(n), n++; c++); print1(c,", "); while(!issquarefree(n), n++)) \\ Rick L. Shepherd, Jul 25 2006
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define (A120992 n) (if (= n 1) (Aincr_points_of_A243348 n) (- (Aincr_points_of_A243348 n) (Aincr_points_of_A243348 (- n 1)))))
    ;; Using these two auxiliary functions, not submitted separately:
    (define Aincr_points_of_A243348 (COMPOSE -1+ (NONZERO-POS 1 1 Afirst_diffs_of_A243348)))
    (define (Afirst_diffs_of_A243348 n) (if (< n 2) (- n 1) (- (A243348 n) (A243348 (- n 1)))))

Extensions

More terms from Emeric Deutsch and Rick L. Shepherd, Jul 25 2006

A112925 Largest squarefree integer < the n-th prime.

Original entry on oeis.org

1, 2, 3, 6, 10, 11, 15, 17, 22, 26, 30, 35, 39, 42, 46, 51, 58, 59, 66, 70, 71, 78, 82, 87, 95, 97, 102, 106, 107, 111, 123, 130, 134, 138, 146, 149, 155, 161, 166, 170, 178, 179, 190, 191, 195, 197, 210, 222, 226, 227, 231, 238, 239, 249, 255, 262, 267, 269, 274, 278
Offset: 1

Views

Author

Leroy Quet, Oct 06 2005

Keywords

Examples

			6 is the largest squarefree less than the 4th prime, 7. So a(4) = 6.
		

Crossrefs

For prime powers instead of squarefree numbers we have A065514, opposite A345531.
Restriction of A070321 (differences A378085) to the primes; see A378619.
The opposite is A112926, differences A378037.
Subtracting each term from prime(n) gives A240473, opposite A240474.
For nonsquarefree numbers we have A378033, differences A378036, see A378034, A378032.
For perfect powers we have A378035.
First differences are A378038.
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers, differences A076259.
A013928 counts squarefree numbers up to n - 1.
A013929 lists the nonsquarefree numbers, differences A078147.
A061398 counts squarefree numbers between primes, zeros A068360.
A061399 counts nonsquarefree numbers between primes, zeros A068361.
A112929 counts squarefree numbers up to prime(n).

Programs

  • Maple
    with(numtheory): a:=proc(n) local p,B,j: p:=ithprime(n): B:={}: for j from 1 to p-1 do if abs(mobius(j))>0 then B:=B union {j} else B:=B fi od: B[nops(B)] end: seq(a(m),m=1..75); # Emeric Deutsch, Oct 14 2005
  • Mathematica
    With[{k = 120}, Table[SelectFirst[Range[Prime@ n - 1, Prime@ n - Min[Prime@ n - 1, k], -1], SquareFreeQ], {n, 60}]] (* Michael De Vlieger, Aug 16 2017 *)
  • PARI
    a(n,p=prime(n))=while(!issquarefree(p--),); p \\ Charles R Greathouse IV, Aug 16 2017

Formula

a(n) = prime(n) - A240473(n). - Gus Wiseman, Jan 10 2025

Extensions

More terms from Emeric Deutsch, Oct 14 2005

A112926 Smallest squarefree integer > the n-th prime.

Original entry on oeis.org

3, 5, 6, 10, 13, 14, 19, 21, 26, 30, 33, 38, 42, 46, 51, 55, 61, 62, 69, 73, 74, 82, 85, 91, 101, 102, 105, 109, 110, 114, 129, 133, 138, 141, 151, 154, 158, 165, 170, 174, 181, 182, 193, 194, 199, 201, 213, 226, 229, 230, 235, 241, 246, 253, 258, 265, 271, 273
Offset: 1

Views

Author

Leroy Quet, Oct 06 2005

Keywords

Examples

			10 is the smallest squarefree number greater than the 4th prime, 7. So a(4) = 10.
From _Gus Wiseman_, Dec 07 2024: (Start)
The first number line below shows the squarefree numbers. The second shows the primes:
--1--2--3-----5--6--7-------10-11----13-14-15----17----19----21-22-23-------26--
=====2==3=====5=====7==========11====13==========17====19==========23===========
(End)
		

Crossrefs

Restriction of A067535, differences A378087.
The unrestricted opposite is A070321, differences A378085.
The opposite is A112925, differences A378038.
Subtracting prime(n) from each term gives A240474, opposite A240473.
For nonsquarefree we have A377783, restriction of A120327.
The nonsquarefree differences are A377784, restriction of A378039.
First differences are A378037.
For perfect power we have A378249, A378617, A378250, A378251.
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.

Programs

  • Maple
    with(numtheory): a:=proc(n) local p,B,j: p:=ithprime(n): B:={}: for j from p+1 to p+20 do if abs(mobius(j))>0 then B:=B union {j} else B:=B fi od: B[1] end: seq(a(m),m=1..75); # Emeric Deutsch, Oct 10 2005
  • Mathematica
    Do[k = Prime[n] + 1; While[ !SquareFreeQ[k], k++ ]; Print[k], {n, 1, 100}] (* Ryan Propper, Oct 10 2005 *)
    With[{k = 120}, Table[SelectFirst[Range[Prime@ n + 1, Prime@ n + k], SquareFreeQ], {n, 58}]] (* Michael De Vlieger, Aug 16 2017 *)
  • PARI
    a(n,p=prime(n))=while(!issquarefree(p++),); p \\ Charles R Greathouse IV, Aug 16 2017

Formula

a(n) = prime(n) + A240474(n). - Gus Wiseman, Dec 07 2024

Extensions

More terms from Ryan Propper and Emeric Deutsch, Oct 10 2005

A061399 Number of nonsquarefree integers between primes prime(n) and prime(n+1).

Original entry on oeis.org

0, 1, 0, 2, 1, 1, 1, 1, 4, 0, 2, 1, 0, 2, 4, 2, 1, 2, 1, 1, 2, 2, 2, 3, 3, 0, 1, 1, 1, 7, 1, 3, 0, 4, 1, 3, 2, 1, 4, 2, 1, 3, 1, 1, 1, 4, 3, 2, 1, 1, 2, 1, 6, 2, 2, 2, 1, 3, 2, 0, 4, 6, 1, 1, 2, 4, 3, 5, 1, 3, 1, 4, 3, 3, 1, 3, 2, 1, 3, 3, 1, 4, 1, 1, 2, 2, 3, 2, 0, 1, 5, 3, 2, 3, 1, 3, 4, 1, 9, 1, 5, 2, 3, 0, 3
Offset: 1

Views

Author

Labos Elemer, Jun 07 2001

Keywords

Examples

			Between 113 and 127 the 7 numbers which are not squarefree are {116,117,120,121,124,125,126}, so a(30)=7.
From _Gus Wiseman_, Dec 07 2024: (Start)
The a(n) nonsquarefree numbers for n = 1..15:
   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
  ----------------------------------------------------------
   .   4   .   8  12  16  18  20  24   .  32  40   .  44  48
               9                  25      36          45  49
                                  27                      50
                                  28                      52
(End)
		

Crossrefs

Zeros are A068361.
First differences of A378086, restriction of A057627 to the primes.
Other classes (instead of nonsquarefree):
- For composite we have A046933, first differences of A065890.
- For squarefree see A061398, A068360, A071403, A373197, A373198, A377431.
- For prime power we have A080101.
- For non prime power we have A368748, see A378616.
- For perfect power we have A377432, zeros A377436.
- For non perfect power we have A377433, A029707.
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers, differences A076259.
A013929 lists the nonsquarefree numbers, differences A078147.
A120327 gives the least nonsquarefree number >= n.

Programs

A070321 Greatest squarefree number <= n.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 7, 7, 7, 10, 11, 11, 13, 14, 15, 15, 17, 17, 19, 19, 21, 22, 23, 23, 23, 26, 26, 26, 29, 30, 31, 31, 33, 34, 35, 35, 37, 38, 39, 39, 41, 42, 43, 43, 43, 46, 47, 47, 47, 47, 51, 51, 53, 53, 55, 55, 57, 58, 59, 59, 61, 62, 62, 62, 65, 66, 67, 67, 69, 70, 71, 71
Offset: 1

Views

Author

Benoit Cloitre, May 11 2002

Keywords

Comments

a(n) = Max( core(k) : k=1,2,3,...,n ) where core(x) is the squarefree part of x (the smallest integer such that x*core(x) is a square).

Examples

			From _Gus Wiseman_, Dec 10 2024: (Start)
The squarefree numbers <= n are the following columns, with maxima a(n):
  1  2  3  3  5  6  7  7  7  10  11  11  13  14  15  15
     1  2  2  3  5  6  6  6  7   10  10  11  13  14  14
        1  1  2  3  5  5  5  6   7   7   10  11  13  13
              1  2  3  3  3  5   6   6   7   10  11  11
                 1  2  2  2  3   5   5   6   7   10  10
                    1  1  1  2   3   3   5   6   7   7
                             1   2   2   3   5   6   6
                                 1   1   2   3   5   5
                                         1   2   3   3
                                             1   2   2
                                                 1   1
(End)
		

Crossrefs

The distinct terms are A005117 (the squarefree numbers).
The opposite version is A067535, differences A378087.
The run-lengths are A076259.
Restriction to the primes is A112925; see A378038, A112926, A378037.
For nonsquarefree we have A378033; see A120327, A378036, A378032, A377783.
First differences are A378085.
Subtracting each term from n gives A378619.
A013929 lists the nonsquarefree numbers, differences A078147.
A061398 counts squarefree numbers between primes, zeros A068360.
A061399 counts nonsquarefree numbers between primes, zeros A068361.

Programs

  • Maple
    A070321 := proc(n)
        local a;
        for a from n by -1 do
            if issqrfree(a) then
                return a;
            end if;
        end do:
    end proc:
    seq(A070321(n),n=1..100) ; # R. J. Mathar, May 25 2023
  • Mathematica
    a[n_] :=For[ k = n, True, k--, If[ SquareFreeQ[k], Return[k]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Mar 27 2013 *)
    gsfn[n_]:=Module[{k=n},While[!SquareFreeQ[k],k--];k]; Array[gsfn,80] (* Harvey P. Dale, Mar 27 2013 *)
  • PARI
    a(n) = while (! issquarefree(n), n--); n; \\ Michel Marcus, Mar 18 2017
    
  • Python
    from itertools import count
    from sympy import factorint
    def A070321(n): return next(m for m in count(n,-1) if max(factorint(m).values(),default=0)<=1) # Chai Wah Wu, Dec 04 2024

Formula

a(n) = n - o(n^(1/5)) by a result of Pandey. - Charles R Greathouse IV, Dec 04 2024
a(n) = A005117(A013928(n+1)). - Ridouane Oudra, Jul 26 2025

Extensions

New description from Reinhard Zumkeller, Oct 03 2002

A045882 Smallest term of first run of (at least) n consecutive integers which are not squarefree.

Original entry on oeis.org

4, 8, 48, 242, 844, 22020, 217070, 1092747, 8870024, 221167422, 221167422, 47255689915, 82462576220, 1043460553364, 79180770078548, 3215226335143218, 23742453640900972, 125781000834058568
Offset: 1

Views

Author

Keywords

Comments

Solution for n=10 is same as for n=11.
This sequence is infinite and each term initiates a suitable arithmetic progression with large differences like squares of primorials or other suitable products of primes from prime factors being on power 2 in terms and in chains after. Proof includes solution of linear Diophantine equations and math. induction. See also A068781, A070258, A070284, A078144, A049535, A077640, A077647, A078143 of which first terms are recollected here. - Labos Elemer, Nov 25 2002

Examples

			a(3) = 48 as 48, 49 and 50 are divisible by squares.
n=5 -> {844=2^2*211; 845=5*13^2; 846=2*3^2*47; 847=7*11^2; 848=2^4*53}.
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 242, p. 67, Ellipses, Paris 2008.

Crossrefs

Cf. A013929, A053806, A049535, A077647, A078143. Also A069021 and A051681 are different versions.

Programs

  • Mathematica
    cnt = 0; k = 0; Table[While[cnt < n, k++; If[! SquareFreeQ[k], cnt++, cnt = 0]]; k - n + 1, {n, 7}]
  • PARI
    a(n)=my(s);for(k=1,9^99,if(issquarefree(k),s=0,if(s++==n,return(k-n+1)))) \\ Charles R Greathouse IV, May 29 2013

Formula

a(n) = 1 + A020754(n+1). - R. J. Mathar, Jun 25 2010
Correction from Jeppe Stig Nielsen, Mar 05 2022: (Start)
a(n) = 1 + A020754(n+1) for 1 <= n < 11.
a(n) = 1 + A020754(n) for 11 <= n < N where N is unknown.
Possibly a(n) = 1 + A020754(n-d) for some higher n, depending on how many repeated terms the sequence has. (End)
a(n) <= A061742(n) = A002110(n)^2 is the trivial bound obtained from the CRT. - Charles R Greathouse IV, Sep 06 2022

Extensions

a(9)-a(11) from Patrick De Geest, Nov 15 1998, Jan 15 1999
a(12)-a(15) from Louis Marmet (louis(AT)marmet.org) and David Bernier (ezcos(AT)yahoo.com), Nov 15 1999
a(16) was obtained as a result of a team effort by Z. McGregor-Dorsey et al. [Louis Marmet (louis(AT)marmet.org), Jul 27 2000]
a(17) was obtained as a result of a team effort by E. Wong et al. [Louis Marmet (louis(AT)marmet.org), Jul 13 2001]
a(18) was obtained as a result of a team effort by L. Marmet et al.

A376593 Second differences of consecutive nonsquarefree numbers (A013929). First differences of A078147.

Original entry on oeis.org

-3, 2, 1, -2, 0, 2, -3, 1, -1, 3, 0, 0, 0, -3, 2, -2, 0, 1, 0, 0, 2, -1, -2, 3, 0, -1, -2, 3, -3, 2, 1, -2, 0, 2, -2, -1, 0, 3, 0, 0, 0, -3, 2, -2, 2, -2, 0, 1, 2, -1, -2, 3, 0, -1, -2, 1, 0, -1, 2, 1, -2, 0, 2, -3, 1, -1, 2, -2, 3, 0, 0, -3, 2, 1, -2, 0, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2024

Keywords

Comments

The range is {-3, -2, -1, 0, 1, 2, 3}.

Examples

			The nonsquarefree numbers (A013929) are:
  4, 8, 9, 12, 16, 18, 20, 24, 25, 27, 28, 32, 36, 40, 44, 45, 48, 49, 50, 52, ...
with first differences (A078147):
  4, 1, 3, 4, 2, 2, 4, 1, 2, 1, 4, 4, 4, 4, 1, 3, 1, 1, 2, 2, 2, 4, 3, 1, 4, 4, ...
with first differences (A376593):
  -3, 2, 1, -2, 0, 2, -3, 1, -1, 3, 0, 0, 0, -3, 2, -2, 0, 1, 0, 0, 2, -1, -2, ...
		

Crossrefs

The version for A000002 is A376604, first differences of A054354.
The first differences were A078147.
Zeros are A376594, complement A376595.
A000040 lists the prime numbers, differences A001223.
A005117 lists squarefree numbers, differences A076259.
A064113 lists positions of adjacent equal prime gaps.
A114374 counts partitions into nonsquarefree numbers.
A246655 lists prime-powers exclusive, inclusive A000961.
A333254 lists run-lengths of differences between consecutive primes.
For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376596 (prime-power inclusive), A376599 (non-prime-power inclusive).
For nonsquarefree numbers: A013929 (terms), A078147 (first differences), A376594 (inflections and undulations), A376595 (nonzero curvature).

Programs

  • Mathematica
    Differences[Select[Range[100],!SquareFreeQ[#]&],2]
  • Python
    from math import isqrt
    from sympy import mobius, factorint
    def A376593(n):
        def f(x): return n+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)
        k = next(i for i in range(1,5) if any(d>1 for d in factorint(m+i).values()))
        return next(i for i in range(1-k,5-k) if any(d>1 for d in factorint(m+(k<<1)+i).values())) # Chai Wah Wu, Oct 02 2024

A120327 Smallest nonsquarefree number >= n.

Original entry on oeis.org

4, 4, 4, 4, 8, 8, 8, 8, 9, 12, 12, 12, 16, 16, 16, 16, 18, 18, 20, 20, 24, 24, 24, 24, 25, 27, 27, 28, 32, 32, 32, 32, 36, 36, 36, 36, 40, 40, 40, 40, 44, 44, 44, 44, 45, 48, 48, 48, 49, 50, 52, 52, 54, 54, 56, 56, 60, 60, 60, 60, 63, 63, 63, 64, 68, 68, 68, 68, 72, 72, 72, 72
Offset: 1

Views

Author

Zak Seidov, Aug 16 2006

Keywords

Crossrefs

For squarefree instead of nonsquarefree we have A067535, differences A378087.
The opposite for squarefree is A070321, differences A378085.
The run-lengths are A078147 if we prepend 4, differences A376593.
The restriction to primes is A377783 (union A378040), differences A377784.
The opposite is A378033 (differences A378036), for prime powers A031218.
First differences are A378039 if we assume that a(1) = 1.
A005117 lists the squarefree numbers.
A013929 lists the nonsquarefree numbers.
A061398 counts squarefree numbers between primes, zeros A068360.
A061399 counts nonsquarefree numbers between primes, zeros A068361.

Programs

  • Mathematica
    Table[NestWhile[ #+1&,n,SquareFreeQ],{n,100}] (* simplified by Harvey P. Dale, Apr 08 2014 *)

A378033 Greatest nonsquarefree number <= n, or 1 if there is none (the case n <= 3).

Original entry on oeis.org

1, 1, 1, 4, 4, 4, 4, 8, 9, 9, 9, 12, 12, 12, 12, 16, 16, 18, 18, 20, 20, 20, 20, 24, 25, 25, 27, 28, 28, 28, 28, 32, 32, 32, 32, 36, 36, 36, 36, 40, 40, 40, 40, 44, 45, 45, 45, 48, 49, 50, 50, 52, 52, 54, 54, 56, 56, 56, 56, 60, 60, 60, 63, 64, 64, 64, 64, 68
Offset: 1

Views

Author

Gus Wiseman, Nov 18 2024

Keywords

Examples

			The nonsquarefree numbers <= 10 are {4, 8, 9}, so a(10) = 9.
		

Crossrefs

For prime-powers we have A031218, differences A377782.
Greatest of the nonsquarefree numbers counted by A057627.
The opposite for squarefree is A067535, differences A378087.
For squarefree we have A070321, differences A378085.
The opposite is A120327 (union A162966), differences A378039.
The restriction to the primes is A378032, opposite A377783 (union A378040).
First-differences are A378036, restriction A378034.
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers, differences A076259, seconds A376590.
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.
A112925 gives the greatest squarefree number < prime(n), differences A378038.
A112926 gives the least squarefree number > prime(n), differences A378037.
A377046 encodes k-differences of nonsquarefree numbers, zeros A377050.

Programs

  • Mathematica
    Table[NestWhile[#-1&,n,#>1&&SquareFreeQ[#]&],{n,100}]
  • PARI
    a(n) = my(k=n); while (issquarefree(k), k--); if(!k, 1, k); \\ Michel Marcus, Jul 26 2025

Formula

a(prime(n)) = A378032(n).
a(n) = A013929(A057627(n)), for n > 3. - Ridouane Oudra, Jul 26 2025
Showing 1-10 of 70 results. Next