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: Don Reble

Don Reble's wiki page.

Don Reble has authored 68 sequences. Here are the ten most recent ones:

A368374 a(n) = smallest k such that AM(k) - GM(k) >= n, where AM(k) and GM(k) are the arithmetic and geometric means of [1,...,k].

Original entry on oeis.org

1, 11, 19, 27, 35, 43, 50, 58, 66, 74, 81, 89, 97, 104, 112, 120, 127, 135, 143, 150, 158, 165, 173, 181, 188, 196, 204, 211, 219, 226, 234, 242, 249, 257, 264, 272, 280, 287, 295, 302, 310, 318, 325, 333, 340, 348, 356, 363, 371, 378, 386, 394, 401, 409, 416
Offset: 0

Author

N. J. A. Sloane, Jan 27 2024, following a suggestion from Don Reble

Keywords

Comments

The difference d(x) = AM(1,2,3,...,x) - GM(1,2,3,...,x) increases. The first difference of d(x) approaches a limit, 1/2 - 1/e (0.13212...). So we could define a(n) to be the least x such that d(x) >= n. - Don Reble, Jan 27 2024. Which is what I did.

Examples

			The values of AM(i)-GM(i) for i = 1, ..., 11 are 0, 0.0857864376269049512, 0.1828794071678603411, 0.2866361605993568152, 0.3948289153026481077, 0.5062048344760910451, 0.6199848408587035501, 0.7356494004968713999, 0.8528337256030871195, 0.9712713118832352378, 1.0907612204156046410, so a(1) = 11.
		

Crossrefs

Programs

  • Maple
    Digits:=20;
    AM := proc(n) local i; add(i,i=1..n)/n; end;
    GM := proc(n) local i; mul(i,i=1..n)^(1/n); end;
    don := proc(n) evalf(AM(n) - GM(n)); end;
    a:=[1]; w:=1;
    for i from 1 to 300 do
       if don(i) >= w then a:=[op(a),i]; w:=w+1; fi;
    od:
    a;
  • Python
    from math import factorial
    def A368374(n):
        if n == 0: return 1
        m = (n<<1)-1
        kmin, kmax = m, m
        while factorial(kmax)< (kmax-m)**kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if factorial(kmid)<Chai Wah Wu, Jan 27 2024

Extensions

a(39)-a(54) from Alois P. Heinz, Jan 27 2024

A355930 Sum of the prime indices of n minus the sum of the prime indices of the smallest number with same prime signature as n, when the sum is taken with multiplicity, as in A056239.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 3, 0, 2, 1, 4, 0, 5, 2, 2, 0, 6, 1, 7, 1, 3, 3, 8, 0, 4, 4, 3, 2, 9, 0, 10, 0, 4, 5, 4, 0, 11, 6, 5, 1, 12, 1, 13, 3, 3, 7, 14, 0, 6, 3, 6, 4, 15, 2, 5, 2, 7, 8, 16, 0, 17, 9, 4, 0, 6, 2, 18, 5, 8, 2, 19, 0, 20, 10, 4, 6, 6, 3, 21, 1, 4, 11, 22, 1, 7, 12, 9, 3, 23, 1, 7, 7, 10, 13, 8, 0, 24, 5, 5, 2, 25, 4, 26, 4, 3
Offset: 1

Author

Antti Karttunen as suggested by Don Reble, Oct 25 2022

Keywords

Comments

a(n) gives the signature excitation of n (a concept proposed by Allan C. Wechsler, indicating the distance of n from the terms of A025487), when the primes in the "excited state", i.e., those present in A328478(n), are de-excited one by one, and the prime signature of n is preserved. See the example.

Examples

			For n = 98 = 2*7*7, the other 7 is de-excited as 7 -> 5 -> 3 -> 2, and the other 7 is de-excited as 7 -> 5 -> 3, to get 2*2*3 = 12 = A046523(98). There are 3+2 de-excitations in total, therefore a(98) = 5.
		

Crossrefs

Cf. A025487 (positions of zeros), A046523, A056239.
Cf. also A319627, A328478, A358218.
Differs from A325799 for the first time at n=18, where a(18) = 1, while A325799(18) = 0.

Programs

  • Mathematica
    {0}~Join~Array[Total@ Flatten[ConstantArray[PrimePi[#1], #2] & @@@ #] - Total@ Flatten@ MapIndexed[ConstantArray[First[#2], #1] &, ReverseSort[#[[All, -1]]]] &@ FactorInteger[#] &, 104, 2] (* Michael De Vlieger, Nov 02 2022 *)
  • PARI
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ From A046523
    A056239(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i, 2] * primepi(f[i, 1]))); }
    A355930(n) = (A056239(n) - A056239(A046523(n)));

Formula

a(n) = A056239(n) - A356159(n) = A056239(n) - A056239(A046523(n)).
For all n, a(n) >= A358218(n). - Antti Karttunen, Nov 05 2022

A343172 Least number k such that the sum of the n Moebius function values beginning at k reaches the minimum value -A083544(n).

Original entry on oeis.org

2, 2, 29, 2, 101, 281, 429, 428, 2081, 6298, 30089, 30088, 143491, 567354, 693677, 693676, 8229, 693674, 1432677, 1123291, 1432677, 2156853, 25085909, 2156851, 25085909, 2156849, 24771577, 24771576, 126398226, 126398226, 3349160985, 389565283, 2928714078, 10441021690, 1353696733
Offset: 1

Author

Don Reble, Apr 21 2021

Keywords

Crossrefs

A341721 a(n) = minimum number of total votes needed for one party to win if there are n voters divided into equal districts.

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 4, 5, 4, 6, 6, 6, 7, 8, 6, 8, 9, 8, 10, 9, 8, 12, 12, 10, 9, 14, 10, 12, 15, 12, 16, 14, 12, 18, 12, 14, 19, 20, 14, 15, 21, 16, 22, 18, 15, 24, 24, 18, 16, 18, 18, 21, 27, 20, 18, 20, 20, 30, 30, 21, 31, 32, 20, 24, 21, 24, 34, 27, 24, 24, 36, 25, 37, 38, 24
Offset: 1

Author

Don Reble and N. J. A. Sloane, Feb 27 2021

Keywords

Comments

This is a two-party election. The size d of each district must divide n, so there are d' = n/d equal districts. The districts are winner-takes-all, and tied districts go to neither candidate. For an even number of districts, it is enough to win half the districts and tie in one further district.
In general the best choice for d is not unique, since d and n/d give the same answer.
This is related to the gerrymandering question.
See A341578 for further information.

Examples

			For n=25 voters the smallest number of votes needed to win is 9: gerrymander 5 districts of 5 voters each, with three votes for the party in each of three districts.
For n=36 voters the smallest number of votes needed to win is 14: gerrymander 3 districts of 12 voters each, with seven votes for the party in each of two districts.
For n=64 voters the smallest number of votes needed to win is 24: gerrymander 8 districts of 8 voters each, with five votes for the party in each of four districts and four votes in a fifth district.
		

Crossrefs

See A341578 for the case when the number of voters must be a square.
See A341319 for a variant.
See also A290323.

Programs

Formula

a(n) is the minimum value over all ways of writing n = d*d' of:
(d+1)*(d'+1)/4 if d and d' are both odd;
(d+2)*(d'+1)/4 if d is even and d' is odd;
(d+1)*(d'+2)/4 if d is odd and d' is even;
(d+2)*(d'+2)/4-1 if d and d' are both even.
a(n) is bounded roughly between n/4 and n/2 (see graph). More precise bounds, which are attained infinitely often, are floor((n+1)/4 + sqrt(n)/2) <= a(n) <= floor((n/2)+1).

A323468 Primes p such that {1,2,3,4,5,6} coset-splits the cyclic multiplicative group modulo p, of order p-1.

Original entry on oeis.org

7, 13, 103, 487, 547, 769, 823, 967, 1063, 1249, 2521, 3049, 3109, 3187, 4327, 4447, 4483, 5167, 5881, 7027, 7207, 7477, 7933, 8221, 8293, 8461, 8527, 8803, 9181, 9721, 9769, 10837, 10867, 11083, 11503, 11527, 11743, 11887, 12043, 12049
Offset: 1

Author

Don Reble, Jan 28 2019

Keywords

References

  • S. K. Stein and S. Szabo, Algebra and Tiling, MAA Carus Monograph 25, 1994, page 77. (Beware omitted values.)

Crossrefs

The Stein/Szabo sequence is A035030.

A291781 Consider the Watanabe tag system defined in A291067; a(n) = number of binary words of length n which terminate in a cycle.

Original entry on oeis.org

0, 0, 4, 12, 16, 32, 64, 128, 384, 704, 896, 2304, 4608, 7680, 16384, 36864, 65536, 143360, 303104, 565248, 1245184, 2473984, 4521984, 9961472, 19070976, 35389440, 78643200, 154664960, 289931264, 635437056, 1309671424, 2503999488, 5280628736
Offset: 1

Author

Don Reble and N. J. A. Sloane, Sep 01 2017

Keywords

Crossrefs

A291780 Consider the Watanabe tag system defined in A291067; a(n) = number of binary words of length n which terminate at the empty word.

Original entry on oeis.org

2, 4, 4, 4, 16, 32, 64, 128, 128, 320, 1152, 1792, 3584, 8704, 16384, 28672, 65536, 118784, 221184, 483328, 851968, 1720320, 3866624, 6815744, 14483456, 31719424, 55574528, 113770496, 246939648, 438304768, 837812224, 1790967808, 3309305856
Offset: 1

Author

Don Reble and N. J. A. Sloane, Sep 01 2017

Keywords

Crossrefs

A291779 a(n) = 2^n - 2^floor(2n/3).

Original entry on oeis.org

0, 1, 2, 4, 12, 24, 48, 112, 224, 448, 960, 1920, 3840, 7936, 15872, 31744, 64512, 129024, 258048, 520192, 1040384, 2080768, 4177920, 8355840, 16711680, 33488896, 66977792, 133955584, 268173312, 536346624, 1072693248, 2146435072, 4292870144, 8585740288, 17175674880, 34351349760, 68702699520
Offset: 0

Author

Don Reble and N. J. A. Sloane, Sep 01 2017

Keywords

Crossrefs

Programs

Formula

G.f.: x/((1-2*x)*(1-4*x^3)). - Robert Israel, Sep 01 2017

A291778 a(n) = 2^floor(2*n/3).

Original entry on oeis.org

1, 1, 2, 4, 4, 8, 16, 16, 32, 64, 64, 128, 256, 256, 512, 1024, 1024, 2048, 4096, 4096, 8192, 16384, 16384, 32768, 65536, 65536, 131072, 262144, 262144, 524288, 1048576, 1048576, 2097152, 4194304, 4194304, 8388608, 16777216, 16777216, 33554432, 67108864, 67108864
Offset: 0

Author

Don Reble and N. J. A. Sloane, Aug 31 2017

Keywords

Crossrefs

Programs

Formula

a(n) = 2^A004523(n).
G.f.: (1+x+2*x^2)/(1-4*x^3). - Robert Israel, Sep 01 2017
From Amiram Eldar, Sep 29 2022: (Start)
Sum_{n>=0} 1/a(n) = 10/3.
Sum_{n>=0} (-1)^n/a(n) = 2/5. (End)

A236411 Let p(k) denote the k-th prime; a(n) = smallest p(m) > p(n) such that the n-2 differences between [p(n), p(n+1), ..., p(2n-2)] are the same as the n-2 differences between [p(m), p(m+1), ..., p(m+n-2)].

Original entry on oeis.org

5, 11, 13, 101, 37, 1277, 1279, 1616603, 57405419, 51448351, 76623356077, 115438255651991, 433241801791933
Offset: 2

Author

Don Reble, Feb 05 2014

Keywords

Examples

			n=5: We take the four primes [p(5)=11, 13, 17, 19], whose successive differences are 2, 4, 2. The next time we see this sequence of differences is at [101, 103, 107, 109], so a(5) = 101.
		

Crossrefs

See A073615 for a very similar sequence.

Programs

  • Mathematica
    (* This program generates the first ten terms of the sequence.  To generate more would require significantly greater computing resources *) dbp[n_]:=Differences[ Prime[ Range[ n,2n-2]]]; With[{prs=Prime[Range[ 3500000]]}, First/@ Flatten[ Table[Select[Partition[Drop[prs,n],n-1,1], Differences[#]==dbp[n]&,1],{n,2,11}],1]] (* Harvey P. Dale, Feb 05 2014 *)
  • PARI
    A236411 = n->{d=vector(n-2,i,prime(n+i)-prime(n));
      forprime(p=prime(n+1),,
        for(k=1,#d, isprime(p+d[k])||next(2));
        for(k=1,#d, p+d[k]==nextprime(p+if(k>1,d[k-1])+1)||next(2));
      return(p))} \\ The second k-loop would suffice, but the first makes it 5x faster. Yields a(10), a(11) in ca. 3 sec (i7, 1.9Ghz). - M. F. Hasler, Feb 05 2014. [Erroneous ')' removed, Oct 09 2023]

Extensions

Edited by N. J. A. Sloane, Feb 05 2014