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: Russell Easterly

Russell Easterly's wiki page.

Russell Easterly has authored 8 sequences.

A173406 This sequence starts with any odd, composite number, like 15. There exists a power of two such that every 2^n + s_i is composite, where s_i is a term in the sequence less than 2^n. For example, 128+15=143, 512+15=527, 512+143=655, etc.

Original entry on oeis.org

15, 143, 527, 655, 1039, 1167, 1551, 1679
Offset: 1

Author

Russell Easterly, Feb 17 2010

Keywords

Comments

We can easily create a k-CNF Boolean IsPrimek() function. Make a list of all composite k-bit binary numbers. Assign each bit to a variable and invert the bits to create a k-clause. Combining these clauses gives us a CNF IsPrimek() function. For example, the 4-clause for 15 (1111 base2) is (~d+~c+~b+~a). The 5-clause for 15 (01111) will be (e+~d+~c+~b+~a). We have to add a variable to the clause for each new power of two until we get to 2^7. 128+15 is composite so we can remove the variable for 128.
This sequence is the list of powers of 2 that can be removed from the CNF clause for 15. I still can't prove this is an infinite sequence. Assume this sequence is finite. Then there exists a finite width prime sieve for powers of two. For every large enough power of two we can find a prime by adding one of the numbers in this sequence (assuming the sequence is finite). The sequence can still be used as a prime sieve even if the sequence is infinite, assuming it grows slowly enough.

A173281 Let a(1) = 1. Given a(1), ..., a(2^t), find the least k such that a(1) + 2^k, a(2) + 2^k, ..., a(2^t) + 2^k are all composite and a(1) + 2^k > a(2^t). Then a(2^t+i) = a(i) + 2^k for all 1 <= i <= 2^t.

Original entry on oeis.org

1, 9, 2049, 2057, 4097, 4105, 6145, 6153, 524289, 524297, 526337, 526345, 528385, 528393, 530433, 530441, 16777217, 16777225, 16779265, 16779273, 16781313, 16781321, 16783361, 16783369, 17301505, 17301513, 17303553, 17303561, 17305601, 17305609, 17307649, 17307657
Offset: 1

Author

Russell Easterly, Feb 14 2010

Keywords

Comments

This sequence can be represented by a single clause in a CNF IsPrime() function.

Programs

  • PARI
    step(v)=my(k=log(v[#v])\log(2));while(1, for(i=1,#v, k++; if(ispseudoprime(2^k+v[i]),next(2))); return(concat(v, vector(#v, i, 2^k+v[i])))) \\ Charles R Greathouse IV, Oct 25 2012

Extensions

a(9)-a(32) from Charles R Greathouse IV, Oct 25 2012

A174088 Number of pairs (i,j) such that i*j == 0 (mod k), 0 <= i <= j < k.

Original entry on oeis.org

1, 2, 3, 5, 5, 8, 7, 11, 12, 14, 11, 21, 13, 20, 23, 26, 17, 33, 19, 37, 33, 32, 23, 51, 35, 38, 42, 53, 29, 68, 31, 58, 53, 50, 59, 87, 37, 56, 63, 91, 41, 98, 43, 85, 96, 68, 47, 122, 70, 100, 83, 101, 53, 123, 95, 131, 93, 86, 59, 181, 61, 92, 138, 132, 113, 158, 67, 133, 113
Offset: 1

Author

Russell Easterly, Mar 06 2010

Keywords

Comments

a(p) = p for p prime, since gcd(k,p) = 1 for 1 <= k < p, the product of k is also coprime to p, but multiples n*p for n >= 1 are plainly divisible by p. - Michael De Vlieger, Nov 22 2019

Crossrefs

Programs

  • Mathematica
    Table[If[PrimeQ@ b, b, Count[Flatten@ Array[# Range@ # &, b], ?(Mod[#, b] == 0 &)]], {b, 69}]  (* _Michael De Vlieger, Nov 22 2019 *)
    f1[p_, e_] := (e*(p - 1)/p + 1)*p^e; f2[p_, e_] := p^Floor[e/2]; a[n_] := (Times @@ f1 @@@ (fct = FactorInteger[n]) + Times @@ f2 @@@ fct)/2; Array[a, 100] (* Amiram Eldar, Apr 28 2023 *)
  • PARI
    a(n)={ my(ct=0); for(i=0,n-1,for(j=0,i, ct+=(Mod(i*j,n)==0) ) ); ct; } \\ Joerg Arndt, Aug 03 2013

Formula

a(n) = ( A018804(n) + A000188(n) ) / 2. - Max Alekseyev, Sep 05 2010

Extensions

More terms from Max Alekseyev, Sep 05 2010
Better name from Joerg Arndt, Aug 03 2013

A090951 LCM of the first n numbers of the form p^q, where p and q are 1 or prime.

Original entry on oeis.org

1, 2, 6, 12, 60, 420, 840, 2520, 27720, 360360, 6126120, 116396280, 2677114440, 13385572200, 40156716600, 1164544781400, 36100888223400, 144403552893600, 5342931457063200, 219060189739591200, 9419588158802421600
Offset: 1

Author

Russell Easterly, Feb 26 2004

Keywords

Comments

Is the sum of the series 1/a(n) transcendental?

Examples

			a(11) = 6126120 = 1*2*3*2*5*7*2*3*11*13*17.
		

Crossrefs

Cf. A051451.

Extensions

Edited and extended by David Wasserman, Mar 13 2006

A091330 a(n) = ((p-1)!/p) - ((p-1)*(p-1)!/p!), where p is the n-th prime.

Original entry on oeis.org

0, 0, 4, 102, 329890, 36846276, 1230752346352, 336967037143578, 48869596859895986086, 10513391193507374500051862068, 8556543864909388988268015483870, 10053873697024357228864849950022572972972
Offset: 1

Author

Russell Easterly, Mar 01 2004

Keywords

Comments

Related to Wilson's Theorem. Let p be a prime number and write 1/p - (p-1)/p! = x/(p-1)!. Then x = (p-1)!/p - (p-1)*(p-1)!/p! = (p-1)!/p - (p-1)/p.
Also, a(n) = floor((p-1)!/p). [Bruno Berselli, May 31 2013]
If b(1)=1, and b(m) = ((m-1)^2 / m) *(b(m-1)+(m-3)/(m-1)) for m>1, then a(n) are the terms of b(m) for m prime. [Pedro Caceres, Dec 30 2018]

Examples

			Prime(4)=7 so a(4) = 6!/7 - 6*6!/7! = 102
		

Crossrefs

Cf. A007619.

Programs

  • Mathematica
    A091330[n_] := Block[{p = Prime[n]}, ((p - 1)!/p) - ((p - 1)*(p - 1)!/p!)] (* Robert G. Wilson v, Mar 02 2004 *)

Extensions

More terms from Robert G. Wilson v and Ray Chandler, Mar 02 2004

A036014 a(n) is the smallest number such that the product a(1)a(2)...a(n) falls between a twin prime pair, starting with a(1)=2.

Original entry on oeis.org

2, 2, 3, 5, 3, 9, 6, 43, 18, 41, 82, 63, 47, 64, 108, 41, 192, 150, 91, 15, 5, 20, 214, 218, 46, 180, 121, 31, 80, 115, 39, 88, 2, 384, 1828, 1219, 360, 113, 2, 1111, 559, 687, 26, 1000, 368, 3130, 1198, 1731, 1752, 1240, 1237, 131, 814, 2349, 949, 64, 284, 361, 120, 3398, 47, 2068, 1001
Offset: 1

Keywords

Examples

			4 between 3,5; 12 between 11,13; 60 between 59,61; etc.
		

Crossrefs

Cf. A014574 (average of twin primes pairs), A359948, A363274.

Programs

  • J
    ms =: [: */ ,
    pp =: [: *./ 1: p: <: , >:
    ty =: [: pp ms
    a1 =: ($: >:)`,@.ty
    2 (a1~^: 30) 2x NB. Stephen Makdisi, May 06 2018
    
  • Mathematica
    d[ 1 ]=2; d[ n_ ] := d[ n ]=Module[ {}, b=Product[ d[ i ], {i, 1, n-1} ]; i=2; While[ Not[ PrimeQ[ i b-1 ]&&PrimeQ[ i b+1 ] ], i++ ]; i ]; Table[ d[ i ], {i, 1, 30} ]
    (* Second Program: *)
    Nest[Append[#, Block[{k = 2}, While[! AllTrue[Times @@ #*k + {-1, 1}, PrimeQ], k++]; k]] &, {2}, 62] (* Michael De Vlieger, May 15 2018 *)
  • PARI
    lista(nn) = {print1(a = 2, ", "); for (n=2, nn, k = 2; while (!(isprime(k*a-1) && isprime(k*a+1)), k++); print1(k, ", "); a *= k;);} \\ Michel Marcus, May 06 2018

Extensions

More terms from Erich Friedman
Name edited by and more terms from Michel Marcus, May 06 2018

A036013 a(n) = smallest number > 1 such that a(1)a(2)...a(n) - 1 is prime (or 1).

Original entry on oeis.org

2, 2, 2, 3, 2, 4, 2, 3, 6, 4, 5, 5, 5, 10, 4, 3, 5, 8, 22, 13, 14, 2, 5, 5, 2, 20, 9, 9, 24, 5, 26, 15, 14, 25, 25, 4, 9, 30, 9, 21, 12, 11, 10, 2, 40, 19, 8, 13, 11, 50, 3, 25, 25, 8, 5, 25, 46, 19, 47, 54, 9, 13, 14, 43, 4, 24, 28, 16, 33, 25, 152, 2, 11, 22, 6, 78, 87, 7, 10, 21
Offset: 1

Keywords

Crossrefs

Cf. A036012, A058000 (corresponding primes).

Programs

  • Mathematica
    sng1[{t_,a_}]:=Module[{k=2},While[CompositeQ[t k-1],k++];{t*k,k}]; NestList[sng1,{2,2},80][[;;,2]] (* Harvey P. Dale, May 20 2023 *)
  • Python
    from sympy import isprime
    from itertools import count
    a,p = [2],2
    for _ in range(100):
        q = next(filter(lambda x:isprime(x*p-1), count(2)))
        p = p*q
        a.append(q)
    print(a) # Nicholas Stefan Georgescu, Mar 06 2023

Extensions

More terms from Erich Friedman. More terms from Jud McCranie, Jan 26 2000.

A036012 a(n) = smallest number > 1 such that a(1)a(2)...a(n) + 1 is prime.

Original entry on oeis.org

2, 2, 3, 3, 2, 6, 3, 2, 4, 7, 7, 3, 8, 6, 2, 3, 6, 9, 6, 14, 19, 11, 4, 4, 19, 4, 13, 3, 10, 13, 15, 4, 11, 9, 2, 5, 26, 19, 52, 21, 20, 63, 4, 19, 17, 6, 29, 19, 3, 5, 51, 11, 14, 15, 7, 12, 44, 34, 7, 21, 32, 3, 22, 10, 19, 19, 7, 20, 4, 22, 4, 17, 35, 47, 40, 14, 5, 14, 36, 39, 16
Offset: 1

Keywords

Comments

Except for the first term, same as A084401. - David Wasserman, Dec 22 2004

Crossrefs

Equals A084716(n+1)/A084716(n).

Programs

  • Maple
    n := 1: while true do j := 2: while not isprime(j*n+1) do j := j+1: od: print(j): n := n*j: od:
  • Mathematica
    a[1] = 2; a[n_] := a[n] = Catch[For[an = 2, True, an++, If[PrimeQ[Product[a[k], {k, 1, n - 1}]*an + 1], Throw[an]]]]; Table[a[n], {n, 1, 81}] (* Jean-François Alcover, Nov 27 2012 *)
    nxt[{t_,n_}]:=Module[{k=2},While[!PrimeQ[t*k+1],k++];{t*k,k}]; NestList[ nxt,{2,2},80][[All,2]] (* Harvey P. Dale, Oct 03 2020 *)
  • Python
    from gmpy2 import is_prime
    from itertools import count, islice
    def agen(): # generator of terms
        p = 1
        while True:
            an = next(k for k in count(2) if (t:=p*k+1) == 1 or is_prime(t))
            p *= an
            yield an
    print(list(islice(agen(), 81))) # Michael S. Branicky, Jan 20 2024

Formula

Conjecture: a(n) = O(n). - Thomas Ordowski, Aug 08 2017

Extensions

More terms from Erich Friedman
More terms from Jud McCranie, Jan 26 2000
Description corrected by Len Smiley