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-7 of 7 results.

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

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

A156898 a(n) = the smallest squarefree integer >= the n-th prime power.

Original entry on oeis.org

1, 2, 3, 5, 5, 7, 10, 10, 11, 13, 17, 17, 19, 23, 26, 29, 29, 31, 33, 37, 41, 43, 47, 51, 53, 59, 61, 65, 67, 71, 73, 79, 82, 83, 89, 97, 101, 103, 107, 109, 113, 122, 127, 127, 129, 131, 137, 139, 149, 151, 157, 163, 167, 170, 173, 179, 181, 191, 193, 197, 199, 211
Offset: 1

Views

Author

Leroy Quet, Feb 17 2009, Feb 18 2009

Keywords

Comments

The first prime power is considered to be 1 here.

Crossrefs

Programs

  • Mathematica
    Block[{nn = 216, s}, s = {1}~Join~Select[Range[nn], PrimePowerQ]; Map[SelectFirst[# + Range[0, #], SquareFreeQ] &, s]] (* Michael De Vlieger, Oct 30 2017 *)

Extensions

Extended by Ray Chandler, Jun 19 2009

A156899 a(n) = the largest prime power <= the n-th positive squarefree integer.

Original entry on oeis.org

1, 2, 3, 5, 5, 7, 9, 11, 13, 13, 13, 17, 19, 19, 19, 23, 25, 29, 29, 31, 32, 32, 32, 37, 37, 37, 41, 41, 43, 43, 47, 49, 53, 53, 53, 53, 59, 61, 61, 64, 64, 67, 67, 67, 71, 73, 73, 73, 73, 79, 81, 83, 83, 83, 83, 89, 89, 89, 89, 89, 97, 101, 101, 103, 103, 103, 107, 109, 109
Offset: 1

Views

Author

Leroy Quet, Feb 17 2009

Keywords

Comments

The first positive squarefree integer is considered to be 1 here.

Crossrefs

Programs

  • Mathematica
    Block[{nn = 110, s}, s = Select[Range[nn], SquareFreeQ]; Map[If[# == 1, 1, SelectFirst[# - Range[0, # - 1], PrimePowerQ]] &, s]] (* Michael De Vlieger, Oct 30 2017 *)

Extensions

Extended by Ray Chandler, Jun 19 2009

A156900 a(n) = the smallest prime power >= the n-th positive squarefree integer.

Original entry on oeis.org

1, 2, 3, 5, 7, 7, 11, 11, 13, 16, 16, 17, 19, 23, 23, 23, 27, 29, 31, 31, 37, 37, 37, 37, 41, 41, 41, 43, 43, 47, 47, 53, 53, 59, 59, 59, 59, 61, 64, 67, 67, 67, 71, 71, 71, 73, 79, 79, 79, 79, 83, 83, 89, 89, 89, 89, 97, 97, 97, 97, 97, 101, 103, 103, 107, 107, 107, 109, 113
Offset: 1

Views

Author

Leroy Quet, Feb 17 2009

Keywords

Comments

The first positive squarefree integer is considered to be 1 here.

Crossrefs

Programs

  • Mathematica
    Block[{nn = 110, s}, s = Select[Range[nn], SquareFreeQ]; Map[If[# == 1, 1, SelectFirst[# + Range[0, # - 1], PrimePowerQ]] &, s]] (* Michael De Vlieger, Oct 30 2017 *)

Extensions

Extended by D. S. McNeil, Mar 23 2009

A081218 Greatest squarefree number not exceeding n-th prime power which is not prime.

Original entry on oeis.org

1, 3, 7, 7, 15, 23, 26, 31, 47, 62, 79, 119, 123, 127, 167, 241, 255, 287, 341, 359, 511, 527, 623, 727, 839, 959, 1023, 1330, 1367, 1679, 1847, 2047, 2186, 2195, 2207, 2399, 2807, 3122, 3478, 3719, 4094, 4487, 4911, 5039, 5327, 6239, 6559, 6857, 6887, 7919
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 10 2003

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Module[{k = n-1}, While[!SquareFreeQ[k], k--]; k]; Join[{1}, f /@ Select[Range[8000], CompositeQ[#] && PrimePowerQ[#] &]] (* Amiram Eldar, Mar 26 2025 *)

Formula

a(n) = A070321(A025475(n)).

A378619 Distance between n and the greatest squarefree number <= n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 12 2024

Keywords

Crossrefs

Positions of 0 are A005117.
Positions of first appearances are A020755 - 1.
Positions of 1 are A053806.
Subtracting each term from n gives A070321.
The opposite version is A081221.
Restriction to the primes is A240473, opposite A240474.
A013929 lists the nonsquarefree numbers, differences A078147.
A061398 counts squarefree numbers between primes, zeros A068360.
A061399 counts nonsquarefree numbers between primes, zeros A068361.

Programs

  • Mathematica
    Table[n-NestWhile[#-1&,n,!SquareFreeQ[#]&],{n,100}]
  • PARI
    A378619(n) = forstep(k=n,1,-1,if(issquarefree(k), return(n-k))); \\ Antti Karttunen, Jan 29 2025
  • Python
    from itertools import count
    from sympy import factorint
    def A378619(n): return n-next(m for m in count(n,-1) if max(factorint(m).values(),default=0)<=1) # Chai Wah Wu, Dec 14 2024
    

Formula

a(n) = n - A070321(n).

Extensions

Data section extended to a(105) by Antti Karttunen, Jan 29 2025
Showing 1-7 of 7 results.