A270344
Least squarefree number that has runs of exactly n nonsquarefree numbers directly preceding and succeeding it.
Original entry on oeis.org
2, 17, 26, 2526, 5876126, 8061827, 8996188226, 5295909711327
Offset: 0
-
(* computes a(n), 1 <= n <= 5 *)
sfRun[n_]:=Module[{i=n}, While[SquareFreeQ[i], i++]; i-n]
nsfRun[n_]:=Module[{i=n}, While[!SquareFreeQ[i], i++]; i-n]
a270344[{low_, high_}]:=Module[{i, next, r, s, list=Table[{},5]}, For[i=low, i<=high, i+=next, r=nsfRun[i]; If[r==0, next=sfRun[i], s=nsfRun[i+r+1]; If[r==s, If[list[[r]]=={}, list[[r]]={i, i+r, i+2r}]; next=2r+2, next=r+1]]]; list]
Map[#[[2]]&, a270344[{0,10000000}]] (* data *)
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
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.
-
(* 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) *)
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
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.
-
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) *)
A271041
a(n) = k is the least squarefree number with a run of zero nonsquarefree numbers immediately preceding k and a run of exactly n>=0 nonsquarefree numbers immediately succeeding k.
Original entry on oeis.org
2, 3, 7, 47, 8474, 843, 22019, 826823, 1092746, 33908367, 262315466
Offset: 0
a(3) = 47 since 46, 47 and 51 are squarefree while 48, 49 and 50 constitute the first nonsquarefree triple after a pair of squarefree numbers.
-
(* We use function a270996[] from A270996 *)
Map[a270996[{0, 1000000},{0, #}]&,Range[0,7]]
(* computes a(0)...a(7) *)
A271042
a(n) = k is the least squarefree number with a run of n >= 0 nonsquarefree numbers immediately preceding k and a run of zero nonsquarefree numbers immediately succeeding k.
Original entry on oeis.org
2, 1, 10, 101, 246, 1685, 22026, 217077, 7216626, 8870033, 262315477, 221167433, 105779897634, 82462576233
Offset: 0
a(3) = 101 since 97, 101 and 102 are squarefree while 98, 99 and 100 constitute the first nonsquarefree triple followed by a pair of squarefree numbers.
-
(* We use function a270996[] from A270996 *)
Map[a270996[{0, 1000000},{#, 0}]&,Range[0,7]]
(* computes a(0)...a(7) *)
Showing 1-5 of 5 results.
Comments