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: Gil Broussard

Gil Broussard's wiki page.

Gil Broussard has authored 111 sequences. Here are the ten most recent ones:

A357923 a(n) is the least number of terms in the sum S = 1/(n+1) + 1/(n+2) + 1/(n+3) + ... such that S > n.

Original entry on oeis.org

1, 3, 17, 68, 242, 812, 2619, 8224, 25345, 77006, 231355, 688758, 2034965, 5973932, 17441201, 50678536, 146643235, 422769139, 1214857227, 3480786068, 9946872233, 28357093263, 80667175724, 229020154166, 649028530125, 1836242560272, 5187142333288, 14632132586005
Offset: 0

Author

Gil Broussard, Oct 20 2022

Keywords

Examples

			For n=0, a single term suffices: S = 1/1 > n = 0.
For n=1, a(1) = 3 terms suffice: S = 1/2 + 1/3 + 1/4 > n = 1.
For n=2, a(3) = 17 terms suffice: S = 1/3 + ... + 1/19 > 2.
		

Crossrefs

Formula

From Thomas Scheuerle, Nov 30 2022: (Start)
a(n) ~ ceiling(exp(n + digamma(1+n)) - (1/2) - n).
floor(digamma(a(n)+n+1) - digamma(n+1)) = n. (End)

Extensions

a(18)-a(27) from Jon E. Schoenfield, Nov 30 2022

A357894 Integers k such that the sum of some number of initial decimal digits of sqrt(k) is equal to k.

Original entry on oeis.org

0, 1, 6, 10, 14, 18, 27, 33, 41, 43, 46, 55, 56, 62, 66, 69, 70, 77, 80, 87, 93, 98, 102, 108, 110, 123, 124, 145, 147, 149, 150, 154, 157, 162, 164, 165, 168, 176, 177, 179, 180, 182, 183, 197, 204, 213, 214, 219, 224, 236, 237, 242, 248, 251, 252, 261, 262, 263, 271, 274, 285, 295
Offset: 1

Author

Gil Broussard, Oct 18 2022

Keywords

Comments

For integers k that are squares of integers, "Sum of initial digits" includes digits to the left of the decimal point only, as there are no digits other than zero to the right of the decimal point. This constraint contributes terms 0 and 1 to the sequence.
For integers k with irrational sqrt(k), "Sum of initial digits" includes digits to the left of the decimal point and to the right of the decimal point.
"Initial digits" implies a sufficient number of digits to produce either a sum > k or a sum = k condition, halting at whichever condition occurs first (sum > k condition is discarded).

Examples

			41 is a term because sqrt(41) = 6.4031242374328... and 6+4+0+3+1+2+4+2+3+7+4+3+2 = 41.
42 is not a term because sqrt(42) = 6.480740698407860... and 6+4+8+0+7+4+0+6 = 35 and 6+4+8+0+7+4+0+6+9 = 44 (no sum of initial digits = 42).
144 is not a term because sqrt(144) = 12 (no digits to the right of the decimal), and 1+2 is not equal to 144.
		

Crossrefs

Cf. A106039.

Programs

  • PARI
    is(n) = { my (d=digits(sqrtint(n)), s=0); for (i=1, #d, s+=d[i]; if (s==n, return (1), s>n, return (0););); if (issquare(n), return (n==0);); my (n0=n); while (1, s+=sqrtint(n0*=100)%10; if (s==n, return (1), s>n, return (0););); } \\ Rémy Sigrist, Oct 19 2022

A346134 The sum S of the maximum number of consecutive primes starting with 2 such that S <= prime(n)^2.

Original entry on oeis.org

2, 5, 17, 41, 100, 160, 281, 328, 501, 791, 874, 1264, 1593, 1720, 2127, 2747, 3447, 3638, 4438, 4888, 5117, 6081, 6870, 7699, 9206, 10191, 10538, 11240, 11599, 12718, 15968, 16840, 18650, 19113, 22039, 22548, 24133, 26369, 27517, 29897, 31734, 32353, 36227, 36888
Offset: 1

Author

Gil Broussard, Jul 05 2021

Keywords

Examples

			a(3) = 2+3+5+7 = 17 because 17 <= prime(3)^2 < 28 = 2+3+5+7+11.
a(4) = 2+3+5+7+11+13 = 41 because 41 <= prime(4)^2 < 58 = 2+3+5+7+11+13+17.
		

Crossrefs

Programs

  • Mathematica
    Table[k=1;While[(s=Sum[Prime@i,{i,++k}])Giorgos Kalogeropoulos, Jul 06 2021 *)
  • PARI
    a(n) = my(s=0, p=2); while (s+p <= prime(n)^2, s += p; p = nextprime(p+1)); s; \\ Michel Marcus, Jul 05 2021
    
  • Python
    from sympy import prime, nextprime
    def a(n):
        p, s, lim = 1, 0, prime(n)**2
        while s <= lim: p = nextprime(p); s += p
        return s - p
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Jul 05 2021

A334292 Number of sets of primes less than the n-th prime whose sum is the n-th prime.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 1, 2, 4, 6, 8, 10, 13, 14, 18, 25, 34, 38, 49, 60, 66, 86, 101, 129, 177, 203, 223, 256, 277, 319, 521, 594, 723, 775, 1063, 1135, 1363, 1633, 1835, 2191, 2600, 2760, 3644, 3862, 4293, 4548, 6261, 8557, 9452, 9963, 11000, 12773, 13437, 17121, 19774, 22799
Offset: 1

Author

Gil Broussard, Apr 21 2020

Keywords

Examples

			a(5) = 0 because 11 is the 5th prime and there are 0 sets of primes < 11 whose sum = 11.
a(9) = 4 because 23 is the 9th prime and there are 4 sets of primes < 23 whose sums = 23: 13+7+3, 13+5+3+2, 11+7+5, 11+7+3+2.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(v, w=primes(nn)); v=Vec(prod(i=1, nn, 1+'x^w[i]) + O('x^(w[nn]+1))); for(i=1, nn, print1(v[w[i]+1]-1, ", ")); } \\ Jinyuan Wang, May 04 2020

Formula

Same generating function as A111133, but on the domain of prime numbers.
a(n) = A070215(n) - 1. - Jinyuan Wang, May 04 2020

Extensions

More terms from David A. Corneth, Apr 22 2020

A269059 Construct a hollow square of 1's of side n and fill its interior with 0's to create a stack of n binary numbers. Express the sum of the stack in decimal.

Original entry on oeis.org

1, 6, 19, 48, 113, 258, 579, 1284, 2821, 6150, 13319, 28680, 61449, 131082, 278539, 589836, 1245197, 2621454, 5505039, 11534352, 24117265, 50331666, 104857619, 218103828, 452984853, 939524118, 1946157079, 4026531864, 8321499161, 17179869210, 35433480219, 73014444060
Offset: 1

Author

Gil Broussard, Feb 18 2016

Keywords

Examples

			     1   1 1  3    1 1 1  7    1 1 1 1  15
a(1)=1   1 1 +3    1 0 1 +5    1 0 0 1 + 9
         a(2)=6    1 1 1 +7    1 0 0 1 + 9
                    a(3)=19    1 1 1 1 +15
                                   a(4)=48
		

Programs

  • Magma
    [1] cat [2*(2^n-1)+(n-2)*(2^(n-1)+1): n in [2..40]]; // Vincenzo Librandi, Feb 27 2016
    
  • Mathematica
    Join[{1}, LinearRecurrence[{6, -13, 12, -4}, {0, 6, 19, 48}, {2, 32}]] (* Jean-François Alcover, Feb 27 2016 *)
  • PARI
    a(n) = if (n==1, 1, 2*(2^n-1)+(n-2)*(2^(n-1)+1)); \\ Michel Marcus, Mar 24 2016
    
  • PARI
    Vec(x*(1-2*x^2)^2/((1-2*x)^2*(1-x)^2) + O(x^100)) \\ Altug Alkan, Mar 24 2016

Formula

a(n) = 2*(2^n-1)+(n-2)*(2^(n-1)+1), for n>1.
G.f.: x*(1-2*x^2)^2/((1-2*x)^2*(1-x)^2). - Robert Israel, Feb 18 2016

A249113 Take n and successively add 1, 2, ..., a(n) until reaching a prime for the third time.

Original entry on oeis.org

4, 5, 16, 5, 11, 13, 8, 6, 19, 6, 12, 13, 7, 9, 28, 5, 11, 13, 12, 17, 19, 6, 11, 25, 8, 6, 28, 5, 20, 37, 7, 14, 19, 10, 11, 34, 8, 6, 40, 6, 20, 25, 8, 9, 31, 6, 11, 25, 19, 21, 19, 6, 12, 25, 16, 9, 28, 5, 20, 22, 7, 14, 40, 9, 11, 34, 19, 6, 52, 17, 12
Offset: 1

Author

Gil Broussard, Oct 21 2014

Keywords

Comments

Conjecturally (Hardy & Littlewood conjecture F), a(n) exists for all n. - Charles R Greathouse IV, Oct 21 2014

Examples

			a(1)=4 because 1+1+2+3+4=11 and exactly two partial sums are prime (2,7).
a(2)=5 because 2+1+2+3+4+5=17 and exactly two partial sums are prime (3,5).
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; Do[k++; While[! PrimeQ[n + Total@ Range@ k], k++], {x, 3}]; k, {n, 71}] (* Michael De Vlieger, Jan 03 2016 *)
  • PARI
    a(n)=my(k,s=3); while(s,if(isprime(n+=k++),s--));k \\ Charles R Greathouse IV, Oct 21 2014
    
  • PARI
    a(n,s=3)=my(k);until(isprime(n+=k++)&&!s--,);k \\ allows one to get A249112(n) as a(n,2). - M. F. Hasler, Oct 21 2014

Formula

n+A000217(k) is prime for k=a(n) and exactly two smaller positive values. - M. F. Hasler, Oct 21 2014

A249112 Second smallest k > 0 such that n+(1+2+...+k) is prime.

Original entry on oeis.org

3, 2, 7, 2, 8, 10, 4, 5, 7, 2, 8, 10, 4, 5, 16, 2, 8, 10, 7, 6, 16, 5, 8, 22, 7, 5, 16, 2, 15, 22, 4, 6, 7, 9, 8, 13, 4, 5, 19, 2, 11, 10, 7, 5, 16, 5, 8, 13, 12, 6, 7, 5, 8, 22, 7, 5, 16, 2, 15, 13, 4, 9, 16, 5, 8, 13, 8, 5, 7, 2, 11, 10, 4, 14, 16, 6, 8
Offset: 1

Author

Gil Broussard, Oct 21 2014

Keywords

Comments

Take the counting numbers and continue adding 1, 2, ..., a(n) until reaching a second prime.
Conjecturally (Hardy & Littlewood conjecture F), a(n) exists for all n. - Charles R Greathouse IV, Oct 21 2014
It appears that the minimum value reached by a(n) is 2, and this occurs for n= 2, 4, 10, 16, 28, 40, 58, 70, ... Is this A144834? - Michel Marcus, Oct 26 2014

Examples

			a(3)=7 because 3+1+2+3+4+5+6+7=31 and one partial sum is prime.
a(4)=2 because 4+1=5 and 4+1+2=7.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; Do[k++; While[! PrimeQ[n + Total@ Range@ k], k++], {x, 2}]; k, {n, 77}] (* Michael De Vlieger, Jan 03 2016 *)
  • PARI
    a(n)=my(k, s=2); while(s, if(isprime(n+=k++), s--)); k \\ Charles R Greathouse IV, Oct 21 2014
    
  • PARI
    a(n,s=2)=my(k);until(isprime(n+=k++)&&!s--,);k \\ allows one to get A249113(n) as a(n,3). - M. F. Hasler, Oct 21 2014

Formula

n+A000217(k) is prime for k=a(n) and exactly one smaller positive value. - M. F. Hasler, Oct 21 2014

A248594 Semiprimes whose next four consecutive integers have exactly three, four, five, and six prime factors, respectively (allowing multiplicity of factors).

Original entry on oeis.org

153221, 196621, 222422, 230261, 288437, 307373, 340421, 400082, 657302, 660713, 706073, 723461, 777773, 838562, 843521, 954581, 961621, 988601, 1009985, 1031846, 1034933, 1190822, 1215821, 1246802, 1384621, 1409873, 1612321, 1723082, 1737122, 1886441
Offset: 1

Author

Gil Broussard, Oct 09 2014

Keywords

Comments

This sequence is related to A113150; for instance, a(14) = 838562 = A113150(1) + 1, since 838561 is prime. - Michel Marcus, Oct 23 2014

Examples

			a(1)=153221 because 153221 is a product of 2 primes (17*9013) and
153222 is a product of 3 primes (2 * 3 * 25537) and
153223 is a product of 4 primes (7 * 7 * 53 * 59) and
153224 is a product of 5 primes (2 * 2 * 2 * 107 * 179) and
153225 is a product of 6 primes (3 * 3 * 3 * 5 * 5 * 227).
		

Crossrefs

Programs

  • PARI
    isok(n) = bigomega(n)==2 && bigomega(n+1)==3 && bigomega(n+2)==4 && bigomega(n+3)==5 && bigomega(n+4)==6; \\ Michel Marcus, Oct 23 2014

A249114 Take the counting numbers and continue adding 1, 2, ..., a(n) until one reaches a fourth prime.

Original entry on oeis.org

7, 6, 19, 10, 12, 25, 11, 9, 40, 13, 15, 25, 11, 17, 67, 6, 15, 22, 15, 18, 43, 9, 12, 34, 12, 9, 31, 9, 32, 58, 8, 21, 28, 14, 12, 37, 11, 9, 55, 13, 23, 46, 11, 14, 43, 10, 15, 34, 24, 26, 28, 9, 15, 37, 23, 18, 40, 6, 24, 61, 8, 18, 43, 22, 27, 37, 20, 9
Offset: 1

Author

Gil Broussard, Oct 21 2014

Keywords

Comments

Conjecturally (Hardy & Littlewood conjecture F), a(n) exists for all n. - Charles R Greathouse IV, Oct 21 2014
It appears that the minimum value reached by a(n) is 6. This occurs for n=2, 16, 58, 136, 178, 418, 598, 808, ... . - Michel Marcus, Oct 26 2014
The conjecture in the previous line is true - if n is odd, then n+1 is even, n+3 is even, n+6 and n+10 are odd, etc., so a(n)>6. If n is even, then +1 and +3 are odd, +6, +10 are even, so the fourth prime can be first for a(n)=6. - Jon Perry, Oct 29 2014
Conjecture: a(n) is odd approximately 50% of the time. - Jon Perry, Oct 29 2014

Examples

			a(1) = 7 because 1+1+2+3+4+5+6+7 = 29 and exactly three partial sums are prime (2,7,11).
a(2) = 6 because 2+1+2+3+4+5+6 = 23 and exactly three partial sums are prime (3,5,17).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local j,count;
          count:= 0;
          for j from 1 do
            if isprime(n + j*(j+1)/2) then
               count:= count+1;
               if count = 4 then return j fi
            fi
          od
    end proc:
    seq(f(n),n=1..100); # Robert Israel, Oct 29 2014
  • Mathematica
    a[n_] := Module[{j, cnt = 0}, For[j = 1, True, j++, If[PrimeQ[n+j(j+1)/2], cnt++; If[cnt == 4, Return[j]]]]];
    Array[a, 100] (* Jean-François Alcover, Oct 03 2020, after Maple *)
  • PARI
    a(n)=my(k, s=4); while(s, if(isprime(n+=k++), s--)); k \\ Charles R Greathouse IV, Oct 21 2014

Formula

a(n) = Min_{k>0 | { n+A000217(j), j=1...k} contains four primes}. - M. F. Hasler, Oct 29 2014

A249140 To obtain a(n), write the n-th composite number as a product of primes, subtract 1 from each prime and multiply.

Original entry on oeis.org

1, 2, 1, 4, 4, 2, 6, 8, 1, 4, 4, 12, 10, 2, 16, 12, 8, 6, 8, 1, 20, 16, 24, 4, 18, 24, 4, 12, 10, 16, 22, 2, 36, 16, 32, 12, 8, 40, 6, 36, 28, 8, 30, 24, 1, 48, 20, 16, 44, 24, 4, 36, 32, 18, 60, 24, 4, 16, 40, 12, 64, 42, 56, 10, 16, 72, 22, 60, 46, 72, 2
Offset: 1

Author

Gil Broussard, Oct 22 2014

Keywords

Examples

			a(1)=1 because the 1st composite number is 4, and the prime factors of 4 are (2,2): (2-1)*(2-1)=1.
a(4)=4 because the 4th composite number is 9, and the prime factors of 9 are (3,3): (3-1)*(3-1)=4.
a(19)=8 because the 19th composite number is 30, and the prime factors of 30 are (2,3,5): (2-1)*(3-1)*(5-1)=8.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local k;
          for k from 1+`if`(n=1, 3, b(n-1))
          while isprime(k) do od; k
        end:
    a:= n-> mul((i[1]-1)^i[2], i=ifactors(b(n))[2]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 23 2014
  • Mathematica
    b[n_] := Product[{p, e} = pe; (p-1)^e, {pe, FactorInteger[n]}];
    b /@ Select[Range[100], CompositeQ] (* Jean-François Alcover, Nov 13 2020 *)
  • PARI
    b(n) = my(f=factor(n)); f[,1] = apply(x->(x-1), f[,1]); factorback(f); \\ A003958
    lista(nn) = apply(b, select(x->((x != 1) && !isprime(x)), [1..nn])); \\ Michel Marcus, Nov 13 2020

Formula

a(n) = A003958(A002808(n)). - Michel Marcus, Oct 22 2014