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.

User: David Dewan

David Dewan's wiki page.

David Dewan has authored 11 sequences. Here are the ten most recent ones:

A385403 Minimum number of triples that cover {1..n}, such that every 2-coloring of {1..n} results in at least one monochromatic triple.

Original entry on oeis.org

10, 10, 7, 8, 8, 8
Offset: 5

Author

David Dewan, Jun 27 2025

Keywords

Comments

There is no solution for n<=4. For example for n=4, the coloring {1=red, 2=red, 3=blue, 4=blue} prevents any monochromatic triple.
This sequence gives the minimum number of triples covering {1..n} that force a monochromatic triple under any 2-coloring. For the contrasting maximum number of triples covering {1..n} that can avoid monochromatic triples under some 2-coloring, see A111384.

Examples

			a(6)=10. For example, these ten triples {{1,2,3}, {1,2,4}, {1,2,5}, {1,3,4}, {1,3,5}, {1,4,6}, {1,5,6}, {2,3,6}, {2,4,5}, {3,4,5}} cover {1..6} and have at least one monochromatic triple for each of the 2^6 = 64 different 2-colorings of {1..6}.
The minimum is 10 because for each of the 167,960 different groups of 9 triples from the C(6,3) = 20 possible triples, there exists a 2-coloring of {1..6} that results in no monochromatic triple.
a(7)=7. For example, these seven triples {{1,2,3}, {1,4,5}, {1,6,7}, {2,4,6}, {2,5,7}, {3,4,7}, {3,5,6}} cover {1..7} and have at least one monochromatic triple for each of the 2^7 = 128 different 2-colorings of {1..7}.
The minimum is 7 because for each of the 1,623,160 different groups of 6 triples from the C(7,3) = 35 possible triples, there exists a 2-coloring of {1..7} that results in no monochromatic triple.
		

Crossrefs

Programs

  • Mathematica
    (* see Links *)

Formula

For n>=7, a(n) <= 7+ceiling((n-7)/3) by extending any minimal 7-triple solution on {1..7} with ceiling((n-7)/3) additional triples covering {8..n}. For example, a(10) <= 8 with {{1,2,3}, {1,4,5}, {1,6,7}, {2,4,6}, {2,5,7}, {3,4,7}, {3,5,6}, {8,9,10}}.

Extensions

a(10) from Jinyuan Wang, Jun 28 2025

A383181 Family of 2-colorings of {1..7824} with no monochromatic Pythagorean triples.

Original entry on oeis.org

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

Author

David Dewan, Apr 18 2025

Keywords

Comments

We use the codes: 1=red, 2=blue, 0=unconstrained (may be red or blue).
Choose any Pythagorean triangle (r,s,t) with t<=7824, then a(r), a(s), a(t) cannot all be the same color (see Examples).
Solution and proof by Heule, Kullmann, and Marek (2016).
Because each of the 2899 numbers for which a(n)=0 can be independently colored red or blue, this sequence represents 2^2899 unique 2-colorings with no monochromatic Pythagorean triples.
There is no 2-coloring of {1..7825} with no monochromatic Pythagorean triples.

Examples

			The triple (5,12,13) is not monochromatic:
  a(5)= 1 red,
  a(12)=2 blue,
  a(13)=2 blue.
The triple (3,4,5) is not monochromatic whether 4 is red or blue:
  a(3)=2 blue,
  a(4)=0 red or blue,
  a(5)=1 red.
		

Crossrefs

A382228 Smallest k such that k^3 is the sum of n consecutive primes.

Original entry on oeis.org

2, 11, 268, 59, 22, 81, 58, 247, 56, 41, 210, 73, 46, 81, 258, 41, 70, 313, 28, 633, 156, 329, 206, 19, 492, 23, 48, 2285, 108, 349, 72, 165, 116, 221, 236, 187, 44, 1083, 82, 295, 34, 347, 54, 35, 548, 23, 32, 2357, 1170, 37, 632, 813, 1590, 277, 1972, 177
Offset: 2

Author

David Dewan, Mar 19 2025

Keywords

Comments

a(1) does not exist because no single prime is a perfect cube.

Examples

			a(2)=2 :    2^3 = 8 = 3 + 5.
a(3)=11 :   11^3 = 1331 = 439 + 443 + 449.
a(4)=268 :  268^3 = 19248832 = 4812191 + 4812193 + 4812209 + 4812239.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Do[mid=PrimePi[k^3/n];toTest=Prime[Range[Max[mid-n,1],mid+n]]; t=Total/@Partition[toTest,n,1];If[MemberQ[t,k^3],Return[k]], {k,2,Infinity}]; a/@Range[2, 10]

Formula

A382227(n) = a(n)^3.

A382227 The smallest perfect cube which is a sum of n consecutive primes.

Original entry on oeis.org

8, 1331, 19248832, 205379, 10648, 531441, 195112, 15069223, 175616, 68921, 9261000, 389017, 97336, 531441, 17173512, 68921, 343000, 30664297, 21952, 253636137, 3796416, 35611289, 8741816, 6859, 119095488, 12167, 110592, 11930499125, 1259712, 42508549, 373248, 4492125, 1560896, 10793861
Offset: 2

Author

David Dewan, Mar 19 2025

Keywords

Comments

a(1) does not exist because no single prime is a perfect cube.

Examples

			a(2)=8        = 3 + 5.
a(3)=1331     = 439 + 443 + 449.
a(4)=19248832 = 4812191 + 4812193 + 4812209 + 4812239.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Do[mid=PrimePi[k^3/n]; toTest=Prime[Range[Max[mid-n,1],mid+n]]; t=Total/@Partition[toTest,n,1]; If[MemberQ[t,k^3],Return[k^3]],{k,2,Infinity}]; a/@Range[2, 10]

Formula

a(n) = A382228(n)^3.

A382226 Smallest prime in a sequence of n consecutive primes which add to a perfect cube.

Original entry on oeis.org

3, 439, 4812191, 41051, 1753, 75869, 24359, 1674289, 17509, 6221, 771653, 29863, 6899, 35353, 1073239, 4001, 18959, 1613741, 1033, 12077759, 172433, 1548149, 364079, 199, 4580399, 373, 3847, 411396253, 41863, 1371031, 11491, 135911, 45707, 308149, 364909, 176537, 2089, 32569961, 13619, 625861
Offset: 2

Author

David Dewan, Mar 19 2025

Keywords

Comments

a(1) does not exist because no single prime is a perfect cube.

Examples

			a(2)=3  :       3 + 5 = 8 = 2^3 = A382227(2).
a(3)=439 :      439 + 443 + 449 = 1331 = 11^3 = A382227(3) = A210205(1).
a(4)=4812191 :   4812191 + 4812193 + 4812209 + 4812239 = 19248832 = 268^3 = A382227(4) = A248587(1).
		

Crossrefs

Programs

  • Maple
    A382226 := proc(n)
            local i,ps,fp,lp ;
            fp := 2;
            ps := add(ithprime(j),j=1..n) ;
            lp := ithprime(n);
            for i from 1 do
                    if isA000578(ps) then #code in A000578
                            return fp;
                    end if;
                    lp := nextprime(lp) ;
                    ps := ps-fp+lp ;
                    fp := nextprime(fp) ;
            end do:
    end proc:
    for n from 2 do
            print(n,A382226(n)) ;
    end do:  # R. J. Mathar, Mar 25 2025
  • Mathematica
    a[n_]:=Do[mid=PrimePi[k^3/n]; toTest=Prime[Range[Max[mid-n, 1], mid+n]];
    t=Total/@Partition[toTest, n, 1];pos=Position[t, k^3];If[pos!={}, Return[First[toTest[[First[pos]]]]]], {k, 2 , Infinity} ];a/@Range[2, 10]

Formula

a(n) = { min prime(k): [ sum(j=k..k+n-1) prime(j)] in A000578 }.

A381707 Smallest initial value for unimodal Collatz (3x+1)/2 glide sequence that begins with exactly n increases.

Original entry on oeis.org

5, 3, 23, 15, 95, 575, 383, 255, 5631, 25599, 104447, 69631, 745471, 3293183, 2195455, 12648447, 97910783, 65273855, 43515903, 1460666367, 6700400639, 4466933759, 71697432575, 47798288383, 764873277439, 1242923270143, 3760646520831, 8371159695359, 5580773130239, 3720515420159
Offset: 1

Author

David Dewan, Mar 04 2025

Keywords

Comments

A unimodal Collatz glide sequence is successive rises x -> (3x+1)/2 followed by successive falls x -> x/2 until dropping below its starting x.
After n increases, there are ceiling(n*log(3)/log(2) - n) decreases to drop below the initial value.

Examples

			For n=3, the smallest starting x = a(3) = 23 has trajectory
  23 - 35 -> 53 ->  80  -> 40 -> 20
     \-----------/      \------/
     n=3 increases   decreases to < initial
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=2^n ModularInverse[3^n,2^Max[Ceiling[Log2[3^n]-n],2]]-1; Array[a,30]
  • PARI
    a(n)={my(m=2^(logint(3^n,2) - n + 1 + (n==1))); 2^n*lift(1/Mod(3^n,m)) - 1} \\ Andrew Howroyd, Mar 09 2025

Formula

a(n) = 2^n * (3^(-n) mod 2^max(2, ceiling(log2(3^n)-n))) - 1.

A381705 Length of iteration sequence of shortest unimodal Collatz (3x+1)/2 sequence that begins with exactly n increases and ends with continuous decreases until reaching 1.

Original entry on oeis.org

3, 6, 13, 32, 87, 250, 737, 2196, 6571, 19694, 59061, 177160, 531455, 1594338, 4782985, 14348924, 43046739, 129140182, 387420509, 1162261488, 3486784423, 10460353226, 31381059633, 94143178852, 282429536507, 847288609470, 2541865828357, 7625597485016, 22876792454991
Offset: 1

Author

David Dewan, Mar 04 2025

Keywords

Comments

A unimodal Collatz sequence has one peak because it starts with only odd numbers (which increase) followed by only even numbers (which decrease). It uses the rule odd x -> (3x+1)/2.
A sequence of length a(n) starts with exactly n odd numbers and ends with 3^(n-1) even numbers and the final 1 for a total length of n + 3^(n-1) + 1.
The peak of a given sequence is 2^(3^(n-1)). See A023365.

Examples

			For n=2, the shortest unimodal sequence has length a(2) = 6 terms and one such sequence is
  3 -> 5 ->  8  -> 4 -> 2 -> 1
    \-----/     \----------/
  2 increases, then decreases
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{5,-7,3},{3,6,13},29] (* James C. McMahon, Apr 02 2025 *)

Formula

a(n) = n + 3^(n-1) + 1.
From Stefano Spezia, Mar 07 2025: (Start)
G.f.: x*(3 - 9*x + 4*x^2)/((1 - x)^2*(1 - 3*x)).
E.g.f.: (exp(3*x) + 3*exp(x)*(1 + x) - 4)/3. (End)

A374505 Maximum number of unit squares aligned with unit-spaced horizontal lines that can be enclosed by a circle of diameter n.

Original entry on oeis.org

0, 0, 1, 4, 8, 14, 21, 29, 40, 52, 65, 81, 97, 116, 135, 156, 180, 203, 229, 258, 286, 317, 350, 383, 419, 455, 495, 536, 575, 620, 664, 711, 761, 808, 860, 916, 966, 1024, 1079, 1140, 1200, 1261, 1326, 1391, 1458, 1528, 1595, 1666, 1741, 1814, 1892, 1972
Offset: 0

Author

David Dewan, Jul 09 2024

Keywords

Comments

It is conjectured that this construction gives the maximal number of axis-parallel unit squares that can be packed into a circle of diameter n.
From the Erich Friedman website the best known maximum number of unit squares enclosed by a circle of diameter n are for n >= 2: 1, 4, 8, 14, 21, 30, ... (this sequence has not been included in OEIS because the terms have not been proven optimal). The unit squares in this case are not required to be axis-parallel. However, the example of 30 axis-parallel squares enclosed in a circle of radius < 3.5 shows that if holes are allowed, better packings are possible than with the restricted case. - Andrew Howroyd, Jul 14 2024

Examples

			For a circle with diameter = 4:
With center of circle at y = 0 (on line between rows) it encloses 6 squares.
With center of circle at y = 2 - sqrt(3) ~= 0.268 it encloses 8 squares (maximal).
With center of circle at y = 1/2 (in middle of row) it encloses 7 squares.
So a(4) = 8.
		

Crossrefs

Cf. A124484, A256588 (unexpectedly similar).

Programs

  • Mathematica
    a[n_] := (
      distances = N[Map[Sqrt[n^2 - #^2]/2 &, Range[n - 1]]];
      topDeltas1 = Flatten[Map[# - distances &, Range[n/2]]];
      topDeltas2 = Select[topDeltas1, 0 < # <= .5 &];
      topDeltas3 = Map[{#, 1} &, topDeltas2];
      btmDeltas1 = Flatten[Map[distances - # &, Range[n/2]]];
      btmDeltas2 = Select[btmDeltas1, 0 <= # < .5 &];
      btmDeltas3 = Map[{#, -1} &, btmDeltas2];
      allDeltas4 = Join[topDeltas3, btmDeltas3, {{0, 0}}];
      allDeltas5 = SortBy[allDeltas4, {First, -Last[#] &}] ;
      cumulativeChanges = Accumulate[allDeltas5[[All, 2]]];
      startSqrs = 2 Sum[Floor[2 Sqrt[(n/2)^2 - k^2]], {k, n/2}];
      Return[startSqrs + Max[cumulativeChanges]]  )
    Map[a[#] &, Range[0, 51]]      (* this sequence *)
    Map[a[#] &, Range[0, 102, 2]]  (* A124484, by radius *)

Formula

a(2*n) <= A124484(n).

A373193 On a unit square grid, the number of squares enclosed by a circle of radius n with origin at the center of a square.

Original entry on oeis.org

1, 5, 21, 37, 61, 89, 129, 177, 221, 277, 341, 401, 489, 561, 657, 749, 845, 949, 1049, 1185, 1313, 1441, 1573, 1709, 1877, 2025, 2185, 2361, 2529, 2709, 2901, 3101, 3305, 3505, 3713, 3917, 4157, 4397, 4637, 4865, 5121, 5377, 5637, 5917, 6197, 6485, 6761
Offset: 1

Author

David Dewan, May 27 2024

Keywords

Comments

This corresponds to a circle of radius n with center at 1/2,1/2 on a unit square grid.
Always has an odd number of rows (2 n - 1) with an odd number of squares in each row.
Symmetrical about the horizontal and vertical axes.

Examples

			For n=4:
  row 1: 3 squares   - - X X X - -
  row 2: 5 squares   - X X X X X -
  row 3: 7 squares   X X X X X X X
  row 4: 7 squares   X X X X X X X
  row 5: 7 squares   X X X X X X X
  row 6: 5 squares   - X X X X X -
  row 7: 3 squares   - - X X X - -
Total = 37 = a(4).
		

Crossrefs

Cf. A119677 (on unit square grid with circle center at origin), A372847 (even number of rows with maximal squares per row), A125228 (odd number of rows with maximal squares per row), A000328 (number of squares whose centers are inside the circle).

Programs

  • Mathematica
    Table[4*Sum[Floor[Sqrt[n^2-(k+1/2)^2]-1/2],{k,1,n-1}]+4*n-3,{n,50}]

Formula

a(n) = 4*Sum_{k=1..n-1} floor(sqrt(n^2 - (k+1/2)^2) - 1/2) + 4*n - 3.
a(n) == 1 (mod 4). - Robert FERREOL, Jan 31 2025

A373008 Radii r of circles that can enclose more unit squares when having fewer rows of squares: 2*r - 2 rows instead of 2*r - 1 rows.

Original entry on oeis.org

19, 52, 65, 184, 197, 222, 230, 303, 328, 341, 425, 489, 646, 985, 1018, 1328, 1383, 1400, 1637, 1743, 1806, 1870, 1938, 1997, 2060, 2065, 2179, 2192, 2433, 2603, 2610, 2611, 2675, 2692, 2747, 2895, 2925, 2975, 3008, 3107, 3254, 3446, 3462, 3619, 3635
Offset: 1

Author

David Dewan, May 19 2024

Keywords

Comments

Numbers r for which A372847(r) > A125228(r).
For circles with these radii, a smaller number of rows (2*r - 2) allows more efficient packing than a larger number of rows (2*r - 1).

Examples

			Radius     2*r-2 rows         2*r-1 rows
19          1072 squares       1071 squares
52          8332 squares       8331 squares
65         13076 squares      13073 squares
		

Crossrefs

Cf. A125228 (odd number of rows with maximum squares per row), A372847 (even number of rows with maximum squares per row).

Programs

  • Mathematica
    lessRows[r_] := 2 Sum[Floor[2 Sqrt[r^2 - k^2]], {k, r - 1}]
    moreRows[r_] := 2 Sum[Floor[2 Sqrt[r^2 - (k + 1/2)^2]], {k, r - 1}] + 2 r - 1
    Select[Range@100,lessRows[#] > moreRows[#] &]

Formula

{ r : 2*Sum_{k=1..r-1} floor(2*sqrt(r^2 - k^2)) > 2*Sum_{k=1..r-1} floor(2*sqrt(r^2 - (k+1/2)^2)) + 2*r - 1 }.