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 32 results. Next

A378036 First differences of A378033 (greatest positive integer < n that is 1 or nonsquarefree).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 18 2024

Keywords

Crossrefs

Positions of 0 are A005117 - 1, complement A013929 - 1.
Sums for squarefree numbers are A070321 (restriction A112925).
The restricted opposite is A377784, differences of A377783 (union A378040).
First-differences of A378033.
The restriction is A378034, differences of A378032.
The restricted opposite for squarefree is A378037, differences of A112926.
The opposite is A378039, differences of A120327 (union A162966).
For squarefree numbers we have A378085, restriction A378038.
The opposite for squarefree is A378087, differences of A067535.
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.
A377046 encodes k-differences of nonsquarefree numbers, zeros A377050.

Programs

  • Mathematica
    Differences[Table[NestWhile[#-1&,n,#>1&&SquareFreeQ[#]&],{n,100}]]
  • PARI
    A378033(n) = if(n<=3, 1, forstep(k=n, 0, -1, if(!issquarefree(k), return(k))));
    A378036(n) = (A378033(1+n)-A378033(n)); \\ Antti Karttunen, Jan 28 2025

Formula

a(prime(n)) = A378034(n).

Extensions

Data section extended to a(107) by Antti Karttunen, Jan 28 2025

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

A065514 Largest power of a prime < prime(n).

Original entry on oeis.org

1, 2, 4, 5, 9, 11, 16, 17, 19, 27, 29, 32, 37, 41, 43, 49, 53, 59, 64, 67, 71, 73, 81, 83, 89, 97, 101, 103, 107, 109, 125, 128, 131, 137, 139, 149, 151, 157, 163, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 243, 256, 257, 263, 269, 271
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 27 2001

Keywords

Crossrefs

Starting with n instead of prime(n) gives A031218 (A377282, A377782).
The squarefree version is A112925 (A070321, A378038).
The opposite squarefree version is A112926 (A378037, restriction of A067535).
Difference from prime(n) is A377289 (restriction of A276781, opposite A377281).
First differences are A377781.
The nonsquarefree version is A378032 (A377783 (restriction of A378033), A378034, A378040).
The perfect power version is A378035.
A000015 gives the least prime power >= n, differences A377780.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A345531 gives the least prime power > prime(n), differences A377703.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057, A377286.

Programs

  • Mathematica
    lpp[n_]:=Module[{k=n-1},While[!PrimePowerQ[k],k--];k]; Join[{1},Table[ lpp[ n],{n,Prime[Range[2,60]]}]] (* Harvey P. Dale, Nov 24 2018 *)
  • Python
    from sympy import factorint, prime
    def A065514(n): return next(filter(lambda m:len(factorint(m))<=1, range(prime(n)-1,0,-1))) # Chai Wah Wu, Oct 25 2024

Extensions

Name edited (1 is technically not a prime power even though it is a power of a prime) by Gus Wiseman, Dec 03 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 *)

A378032 a(1) = a(2) = 1; a(n>2) is the greatest nonsquarefree number < prime(n).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 16 2024

Keywords

Examples

			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}
		

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.

Programs

  • Mathematica
    Table[NestWhile[#-1&,Prime[n],#>1&&SquareFreeQ[#]&],{n,100}]

Formula

a(n) = A378033(prime(n)).

A071403 Which squarefree number is prime? a(n)-th squarefree number equals n-th prime.

Original entry on oeis.org

2, 3, 4, 6, 8, 9, 12, 13, 16, 18, 20, 24, 27, 29, 31, 33, 37, 38, 42, 45, 46, 50, 52, 56, 61, 62, 64, 67, 68, 71, 78, 81, 84, 86, 92, 93, 96, 100, 103, 105, 109, 110, 117, 118, 121, 122, 130, 139, 141, 142, 145, 149, 150, 154, 158, 162, 166, 167, 170, 172, 174, 180
Offset: 1

Views

Author

Labos Elemer, May 24 2002

Keywords

Comments

Also the number of squarefree numbers <= prime(n). - Gus Wiseman, Dec 08 2024

Examples

			a(25)=61 because A005117(61) = prime(25) = 97.
From _Gus Wiseman_, Dec 08 2024: (Start)
The squarefree numbers up to prime(n) begin:
n = 1  2  3  4   5   6   7   8   9  10
    ----------------------------------
    2  3  5  7  11  13  17  19  23  29
    1  2  3  6  10  11  15  17  22  26
       1  2  5   7  10  14  15  21  23
          1  3   6   7  13  14  19  22
             2   5   6  11  13  17  21
             1   3   5  10  11  15  19
                 2   3   7  10  14  17
                 1   2   6   7  13  15
                     1   5   6  11  14
                         3   5  10  13
                         2   3   7  11
                         1   2   6  10
                             1   5   7
                                 3   6
                                 2   5
                                 1   3
                                     2
                                     1
The column-lengths are a(n).
(End)
		

Crossrefs

The strict version is A112929.
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers, differences A076259.
A013929 lists the nonsquarefree numbers, differences A078147.
A070321 gives the greatest squarefree number up to n.
Other families: A014689, A027883, A378615, A065890.
Squarefree numbers between primes: A061398, A068360, A373197, A373198, A377430, A112925, A112926.
Nonsquarefree numbers: A057627, A378086, A061399, A068361, A120327, A377783, A378032, A378033.

Programs

  • Mathematica
    Position[Select[Range[300], SquareFreeQ], ?PrimeQ][[All, 1]] (* _Michael De Vlieger, Aug 17 2023 *)
  • PARI
    lista(nn)=sqfs = select(n->issquarefree(n), vector(nn, i, i)); for (i = 1, #sqfs, if (isprime(sqfs[i]), print1(i, ", "));); \\ Michel Marcus, Sep 11 2013
    
  • PARI
    a(n,p=prime(n))=sum(k=1, sqrtint(p), p\k^2*moebius(k)) \\ Charles R Greathouse IV, Sep 13 2013
    
  • PARI
    a(n,p=prime(n))=my(s); forfactored(k=1, sqrtint(p), s+=p\k[1]^2*moebius(k)); s \\ Charles R Greathouse IV, Nov 27 2017
    
  • PARI
    first(n)=my(v=vector(n),pr,k); forsquarefree(m=1,n*logint(n,2)+3, k++; if(m[2][,2]==[1]~, v[pr++]=k; if(pr==n, return(v)))) \\ Charles R Greathouse IV, Jan 08 2018
    
  • Python
    from math import isqrt
    from sympy import prime, mobius
    def A071403(n): return (p:=prime(n))+sum(mobius(k)*(p//k**2) for k in range(2,isqrt(p)+1)) # Chai Wah Wu, Jul 20 2024

Formula

A005117(a(n)) = A000040(n) = prime(n).
a(n) ~ (6/Pi^2) * n log n. - Charles R Greathouse IV, Nov 27 2017
a(n) = A013928(A008864(n)). - Ridouane Oudra, Oct 15 2019
From Gus Wiseman, Dec 08 2024: (Start)
a(n) = A112929(n) + 1.
a(n+1) - a(n) = A373198(n) = A061398(n) - 1.
(End)

A377783 Least nonsquarefree number > prime(n).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 16 2024

Keywords

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.

Examples

			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}
		

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.

Programs

  • Mathematica
    Table[NestWhile[#+1&,Prime[n],SquareFreeQ],{n,100}]

Formula

a(n) = A120327(prime(n)).

Extensions

Proof suggested by Amiram Eldar.

A377784 First-differences of A377783 (least nonsquarefree number > prime(n)).

Original entry on oeis.org

0, 4, 0, 4, 4, 2, 2, 4, 8, 0, 8, 4, 0, 4, 6, 6, 3, 5, 4, 3, 5, 4, 6, 8, 6, 0, 4, 4, 4, 12, 4, 8, 0, 10, 2, 8, 4, 4, 7, 5, 4, 8, 4, 2, 2, 12, 12, 4, 4, 2, 6, 2, 10, 8, 4, 6, 2, 7, 5, 0, 10, 14, 4, 3, 5, 12, 6, 10, 2, 6, 4, 8, 7, 5, 4, 8, 8, 4, 8, 8, 3, 9, 4, 4
Offset: 1

Views

Author

Gus Wiseman, Nov 18 2024

Keywords

Comments

There are no consecutive 0's.
Does this sequence contain every positive integer > 1?

Crossrefs

Positions of 0's are A068361.
The opposite for squarefree is A378038, differences of A112925.
For prime-power instead of nonsquarefree and primes + 1 we have A377703, first-differences of A345531.
First-differences of A377783, union A378040.
The opposite is A378034 (differences of A378032), restriction of A378036 (differences A378033).
For squarefree instead of nonsquarefree we have A378037, first-differences of A112926.
Restriction of A378039 (first-differences of A120327) to the primes.
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers.
A013929 lists the nonsquarefree numbers, differences A078147, seconds A376593.
A061398, A068360, A337030, A377430, A377431 count squarefree numbers between primes.
A061399, A068361, A378086 count nonsquarefree numbers between primes.
A070321 gives the greatest squarefree number up to n.

Programs

  • Mathematica
    Differences[Table[NestWhile[#+1&,Prime[n],SquareFreeQ[#]&],{n,100}]]

A378034 First-differences of A378032 (greatest number < prime(n) that is 1 or nonsquarefree).

Original entry on oeis.org

0, 3, 0, 5, 3, 4, 2, 2, 8, 0, 8, 4, 0, 5, 7, 4, 4, 4, 4, 4, 4, 5, 7, 8, 4, 0, 4, 4, 4, 14, 2, 8, 0, 12, 2, 6, 6, 2, 8, 4, 4, 9, 3, 4, 2, 10, 12, 5, 3, 4, 4, 4, 10, 6, 5, 7, 2, 6, 4, 0, 12, 14, 2, 4, 4, 12, 8, 8, 4, 4, 4, 8, 8, 6, 2, 8, 8, 4, 8, 8, 4, 8, 4, 4
Offset: 1

Views

Author

Gus Wiseman, Nov 18 2024

Keywords

Crossrefs

Positions of 0 are A068361.
The opposite for prime-powers is A377703, differences of A345531.
For prime-powers we have A377781, differences of A065514.
The opposite is A377784, differences of A377783 (union A378040).
First-differences of A378032.
Restriction of A378036, differences of A378033.
The opposite for squarefree numbers is A378037, differences of A112926.
For squarefree numbers we have A378038, differences of A112925.
The unrestricted opposite is A378039, differences of A120327 (union A162966).
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.

Programs

  • Mathematica
    Differences[Table[NestWhile[#-1&,Prime[n],#>1&&SquareFreeQ[#]&],{n,100}]]

Formula

a(n) = A378036(prime(n)).
Showing 1-10 of 32 results. Next