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.

Previous Showing 21-28 of 28 results.

A378369 Distance between n and the least nonsquarefree number >= n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 01 2024

Keywords

Comments

All terms are 0, 1, 2, or 3 (cf. A078147).

Crossrefs

Adding n to each term a(n) gives A120327.
Positions of 0 are A013929.
Positions of 1 are A373415.
Positions of 2 are A378458.
Positions of 3 are A007675.
Sequences obtained by adding n to each term are placed in parentheses below.
The version for primes is A007920 (A007918).
The version for perfect powers is A074984 (A377468).
The version for squarefree numbers is A081221 (A067535).
The version for non-perfect powers is A378357 (A378358).
The version for prime powers is A378370 (A000015).
The version for non prime powers is A378371 (A378372).
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A120992 gives run-lengths of squarefree numbers increasing by one.

Programs

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

A073249 Nonprime squarefree numbers n such that both n-1 and n+1 are not squarefree and not prime.

Original entry on oeis.org

26, 51, 55, 91, 161, 170, 235, 249, 295, 305, 339, 341, 362, 377, 413, 415, 451, 485, 489, 530, 551, 559, 579, 595, 629, 638, 649, 651, 665, 667, 685, 687, 703, 721, 723, 737, 749, 849, 851, 874, 917, 926, 949, 951, 955, 962, 989, 1015, 1027, 1057, 1059
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 22 2002

Keywords

Crossrefs

Programs

  • Mathematica
    npsQ[n_]:=SquareFreeQ[n]&&NoneTrue[n+{1,0,-1},PrimeQ]&&NoneTrue[n+{1,-1},SquareFreeQ]; Select[Range[2000],npsQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 20 2019 *)
    Mean/@SequencePosition[Table[Which[CompositeQ[n]&&SquareFreeQ[n],1,!SquareFreeQ[ n] && CompositeQ[ n],-1,True,0],{n,1100}],{-1,1,-1}] (* Harvey P. Dale, Jun 17 2022 *)

Extensions

Corrected by Harvey P. Dale, Jan 20 2019

A270996 T(i, j) = k is the least squarefree number with a run of exactly i>=0 nonsquarefree numbers immediately preceding k and a run of exactly j>=0 nonsquarefree numbers immediately succeeding k.

Original entry on oeis.org

2, 1, 3, 10, 17, 7, 101, 149, 151, 47, 246, 51, 26, 97, 8474, 1685, 8479, 727, 1861, 241, 843, 22026, 849, 3178, 2526, 10826, 30247, 22019, 217077, 190453, 813251, 55779, 183553, 5045, 580847, 826823
Offset: 0

Views

Author

Hartmut F. W. Hoft, Mar 28 2016

Keywords

Comments

The sequence a(n) = T(i, j) represents the traversal of this matrix by its successive rising antidiagonals.
a(2*i*(i+1)) = A270344(i), for all i >= 0.

Examples

			a(13) = T(1, 3) = 97 since 96, 98, 99 and 100 are nonsquarefree while 95, 97, and 101 are squarefree, and 97 is the smallest number surrounded by the 1,3 pattern.
The matrix T(i, j) with first 8 complete antidiagonals together with some additional elements including the first 7 elements on the diagonal which are A270344(0)..A270344(6):
-------------------------------------------------------------------------
i\j      0       1       2       3        4         5          6        7
-------------------------------------------------------------------------
0:       2       3       7      47     8474       843      22019   826823
1:       1      17     151      97      241     30247     580847   217069
2:      10     149      26    1861    10826      5045     204322 16825126
3:     101      51     727    2526   183553   1944347   28591923 43811049
4:     246    8479    3178   55779  5876126  19375679   67806346
5:    1685     849  813251  450553 29002021   8061827 2082929927
6:   22026  190453  200854 4100277 97447622 245990821 8996188226
7:  217077  826831 7507930 90557979
T(6, 5) = 245990821, T(5, 6) = 2082929927, and all numbers in antidiagonal 11 are larger than 10^8.
		

Crossrefs

Programs

  • Mathematica
    (* The function computes the least number in the specified interval *)
    nsfRun[n_] := Module[{i=n}, While[!SquareFreeQ[i], i++]; i-n]
    a270996[{low_, high_},{widthL_, widthR_}] := Module[{i=low, r, s, first=0}, While[i<=high, r=nsfRun[i]; If[r != widthL, i+=r+1, s=nsfRun[i+r+1]; If[s != widthR, If[s != widthL, i+=r+s+2, i+=r+1], first=i+r; i=high+1]]]; first]
    a270996[{0, 5000},{2, 3}] (* computes a(18) = T(2, 3) *)

A378618 Sum of nonsquarefree numbers between prime(n) and prime(n+1).

Original entry on oeis.org

0, 4, 0, 17, 12, 16, 18, 20, 104, 0, 68, 40, 0, 89, 199, 110, 60, 127, 68, 72, 151, 161, 172, 278, 297, 0, 104, 108, 112, 849, 128, 403, 0, 579, 150, 461, 322, 164, 680, 351, 180, 561, 192, 196, 198, 819, 648, 449, 228, 232, 470, 240, 1472, 508, 521, 532, 270
Offset: 1

Views

Author

Gus Wiseman, Dec 09 2024

Keywords

Examples

			The nonsquarefree numbers between prime(24) = 89 and prime(25) = 97 are {90, 92, 96}, so a(24) = 278.
		

Crossrefs

For prime instead of nonsquarefree we have A001043.
For composite instead of nonsquarefree we have A054265.
Zeros are A068361.
A000040 lists the primes, differences A001223, seconds A036263.
A070321 gives the greatest squarefree number up to n.
A071403 counts squarefree numbers up to prime(n), restriction of A013928.
A120327 gives the least nonsquarefree number >= n.
A378086 counts nonsquarefree numbers up to prime(n), restriction of A057627.
For squarefree numbers (A005117, differences A076259) between primes:
- length is A061398, zeros A068360
- min is A112926, differences A378037
- max is A112925, differences A378038
- sum is A373197
For nonsquarefree numbers (A013929, differences A078147) between primes:
- length is A061399
- min is A377783 (differences A377784), union A378040
- max is A378032 (differences A378034), restriction of A378033 (differences A378036)
- sum is A378618 (this)

Programs

  • Mathematica
    Table[Total[Select[Range[Prime[n],Prime[n+1]],!SquareFreeQ[#]&]],{n,100}]

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

A378458 Squarefree numbers k such that k + 1 is squarefree but k + 2 is not.

Original entry on oeis.org

2, 6, 10, 14, 22, 30, 34, 38, 42, 46, 58, 61, 66, 70, 73, 78, 82, 86, 94, 102, 106, 110, 114, 118, 122, 130, 133, 138, 142, 145, 154, 158, 166, 173, 178, 182, 186, 190, 194, 202, 205, 210, 214, 218, 222, 226, 230, 238, 246, 254, 258, 262, 266, 273, 277, 282
Offset: 1

Views

Author

Gus Wiseman, Dec 02 2024

Keywords

Comments

These are the positions of 2 in A378369 (difference between n and the next nonsquarefree number).
The asymptotic density of this sequence is Product_{p prime} (1 - 2/p^2) - Product_{p prime} (1 - 3/p^2) = A065474 - A206256 = 0.19714711803343537224... . - Amiram Eldar, Dec 03 2024

Crossrefs

Complement of A007675 within A007674.
The version for prime power instead of nonsquarefree is a subset of A006549.
Another variation is A073247.
The version for nonprime instead of squarefree is A179384.
Positions of 0 in A378369 are A013929.
Positions of 1 in A378369 are A373415.
Positions of 2 in A378369 are A378458 (this).
Positions of 3 in A378369 are A007675.
A000961 lists the powers of primes, differences A057820.
A120327 gives the least nonsquarefree number >= n.
A378373 counts composite numbers between nonsquarefree numbers.

Programs

  • Mathematica
    Select[Range[100],NestWhile[#+1&,#,SquareFreeQ[#]&]==#+2&]
  • PARI
    list(lim) = my(q1 = 1, q2 = 1, q3); for(k = 3, lim, q3 = issquarefree(k); if(q1 && q2 &&!q3, print1(k-2, ", ")); q1 = q2; q2 = q3); \\ Amiram Eldar, Dec 03 2024

A271145 a(n) = k is the least number at which an isolated alternating run of nonsquarefree/squarefree (nsf/sf) numbers of size n starts.

Original entry on oeis.org

2, 14, 482, 6346
Offset: 0

Views

Author

Hartmut F. W. Hoft, Mar 31 2016

Keywords

Comments

A contiguous sequence of numbers satisfying the pattern sf sf nsf sf ... nsf sf nsf sf sf with k+1 nsf numbers alternating with k sf numbers that are bounded by a pair of sf numbers at both ends is called an isolated alternating nsf/sf run of size k. The left sf bounding number is the start of the run.
Any such run must start at an even number i and have an even size j, since for i odd i+3 is nsf, and for i even and j odd i+2*j+4 is nsf.
For all n>=0, a(n)+2 is divisible by 4.
a(4) > 5*10^9

Examples

			a(0) = 2 since 2, 3, 5 and 6 are sf while 4 is nsf.
a(2) = 482 since in the interval 482...494 the nsf/sf pattern is sf sf nsf sf nsf sf nsf sf nsf sf nsf sf sf and it is the first occurrence of that 13-number run.
		

Crossrefs

Programs

  • Mathematica
    nsfRun[n_] := Module[{i=n}, While[!SquareFreeQ[i], i++]; i-n]
    sfRun[n_] := Module[{i=n}, While[SquareFreeQ[i], i++]; i-n]
    sfBlockSearch[i_] := Module[{searching=True, j=i, r, s}, While[searching, r=nsfRun[j]; s=sfRun[j+r]; If[s<2, j+=r+s, searching=False]]; j+r+s]
    nsfsfPairQ[i_] := nsfRun[i]==1 && sfRun[i+1]==1
    nsfsfEndQ[i_] := nsfRun[i]==1 && sfRun[i+1]>1
    nsfsfRun[i_] := Module[{searching=True, count, j=i, s, e}, j=sfBlockSearch[j]; While[searching, count=0; s=j; While[nsfsfPairQ[j], count++; j+=2]; e=j; If[count==0 || !nsfsfEndQ[j], j=sfBlockSearch[j], searching=False]]; {s, e, count}]
    a271145[{low_, high_}, b_] := Module[{i=low, k, k3, list=Table[{}, b]}, While[i<=high, k=nsfsfRun[i]; k3=Last[k]/2; If[list[[k3]]=={}, list[[k3]]=k[[1]]-2]; i=k[[2]]]; list]
    a271145[{0, 10000}, 3] (* computes a(1), a(2), a(3) *)

A378179 Squarefree numbers k whose neighbors are neither squarefree nor prime powers.

Original entry on oeis.org

19, 51, 53, 55, 89, 91, 97, 149, 151, 161, 163, 197, 199, 233, 235, 241, 249, 251, 269, 271, 293, 295, 305, 307, 337, 339, 341, 349, 377, 379, 413, 415, 449, 451, 485, 487, 489, 491, 521, 523, 551, 557, 559, 577, 579, 593, 595, 629, 631, 638, 649, 651, 665, 667
Offset: 1

Views

Author

Michael De Vlieger, Nov 24 2024

Keywords

Examples

			Numbers k < 12 are not in the sequence since 12 is the smallest number in A126706.
13 and 15 are not in the sequence since 14 is squarefree.
17 is not in the sequence since 16 = 2^4.
a(1) = 19 since 19 is the smallest squarefree number such that 18 = 2*3^2 and 20 = 2*5^2 are not prime powers, but are divisible by a prime square.
a(2) = 51 since 50 = 2*5^2 and 52 = 2^2*13.
a(3) = 53 since 54 = 2*3^3.
a(4) = 55 since 56 = 7*2^3.
a(5) = 89 since 88 = 2^3*11 and 90 = 2*3^2*5, etc.
		

Crossrefs

Subsequence of A073247.

Programs

  • Mathematica
    Reap[Do[If[
      And[SquareFreeQ[n],
        AllTrue[n + {-1, 1}, Nor[SquareFreeQ[#], PrimePowerQ[#]] &]],
      Sow[n]], {n, 1000}] ][[-1, 1]]
  • PARI
    list(lim)=my(v=List(),l1,l2); forfactored(k=18,lim\1+1, if(!issquarefree(k) && !issquarefree(l2) && issquarefree(l1) && #k[2][,1]>1 && #l2[2][,1]>1, listput(v,l1[1])); l2=l1; l1=k); Vec(v) \\ Charles R Greathouse IV, Nov 27 2024
Previous Showing 21-28 of 28 results.