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: Lear Young

Lear Young's wiki page.

Lear Young has authored 12 sequences. Here are the ten most recent ones:

A235644 Number of decompositions of 12*n into the sum of two (not necessarily distinct) twin prime pairs.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 0, 2, 1, 3, 3, 1, 2, 1, 3, 2, 2, 2, 3, 1, 3, 1, 2, 3, 3, 6, 2, 3, 1, 2, 4, 3, 4, 4, 1, 3, 2, 3, 5, 2, 7, 1, 3, 2, 2, 5, 2, 5, 2, 3, 2, 2, 3, 5, 3, 4, 1, 0, 3, 1, 6, 2, 3, 3, 1, 5, 2, 5, 3, 3, 4, 1, 4
Offset: 1

Author

Lear Young, Jun 16 2014

Keywords

Comments

In the 1980's, Liang conjectured that (6n)^2 = p_1 + p_2 + p_3 + p_4, where (p_1, p_2) and (p_3, p_4) are twin prime pairs. See reference for more details.
It seems there are at least 2 solutions for the decompositions when n > 701.
If the two twin prime pairs are required to be distinct, the sequence is A187759.

Examples

			a(736) = 2 because 12*736 = 197 + 199 + 4217 + 4219 = 857 + 859 + 3557 + 3559, so there are 2 ways of expressing 12*n as the sum of two twin prime pairs.
		

References

  • Liang Ding Xiang, Problem 93#, Bulletin of Mathematics (Wuhan), 6(1992),41. ISSN 0488-7395.

Crossrefs

Programs

  • PARI
    v=select(p->isprime(p-2)&&p>5, primes(200))\6; l=List(); for(i=1, #v, if(2*v[i]<100, listput(l, 2*v[i])); for(j=i+1, #v, if((v[i]+v[j])<100, listput(l, v[i]+v[j])))); l1=vecsort(l); k=1; for(i=1, 100, s=sum(j=k, #l1, l1[j]==i); print1(s", "); k+=s) \\ Lear Young, Jun 16 2014
    
  • PARI
    v=select(p->isprime(p-2)&&p>5,primes(110))\6;for(i=1, 99, print1(sum(j=1,#v,vecsearch(v,i-v[j])>0 && i-v[j]>=v[j])", "))   \\ change i-v[j]>=v[j] to i-v[j]>v[j] is A187759.  Lear Young, Jun 16 2014

A243956 Positive numbers n without a decomposition into a sum n = i+j such that 6i-1, 6i+1, 6j-1, 6j+1 are twin primes.

Original entry on oeis.org

1, 16, 67, 86, 131, 151, 186, 191, 211, 226, 541, 701
Offset: 1

Author

Lear Young, Jun 15 2014

Keywords

Comments

Conjecture: any integer n > 701 has a decomposition into a sum n = i+j such that 6i-1, 6i+1, 6j-1, 6j+1 are twin primes.

Crossrefs

Programs

  • Maple
    b:= n-> isprime(6*n-1) and isprime(6*n+1):
    a:= proc(n) option remember; local i, k, ok;
          for k from 1 +`if`(n=1, 0, a(n-1)) do ok:= true;
            for i to iquo(k, 2) while ok
              do ok:= not(b(i) and b(k-i)) od;
            if ok then return k fi
          od
        end:
    seq(a(n), n=1..12);  # Alois P. Heinz, Jun 20 2014
  • PARI
    l=List();a=select(p->isprime(p-2)&&p>5, primes(2000))\6;
    for(i=1,#a-1,listput(l,2*a[i]);for(j=i+1,#a,listput(l,(a[i]+a[j]))));
    print(setminus(Set(vector(l[#l]/4, i, i)), Set(l)))

A243914 Even numbers which are twice the sum of a twin prime pair, but cannot be expressed as the sum of 2 distinct twin prime pairs.

Original entry on oeis.org

16, 24, 792, 1392
Offset: 1

Author

Lear Young, Jun 14 2014

Keywords

Comments

Subsequence of A111046 (twice A054735).
It seems that this sequence is probably finite (there are no further terms below 10^7).

Examples

			a(1) = 16 = 2*(3+5).
16 is in the sequence since it is twice the sum of twin primes 3 and 5, but cannot be expressed as the sum of 2 distinct twin pairs.
36 is not in the sequence because although it is the sum of twin primes 17 and 19, it can also be expressed as the sum of pairs (5, 7) and (11, 13).
		

Crossrefs

Programs

  • Maple
    with(SignalProcessing): # requires at least Maple 17
    N:= 10^6; # to check primes up to N
    Primes:= select(isprime,{seq(2*i+1,i=1..N)}):
    Twins:= Primes intersect map(t-> t-2,Primes):
    nT:= nops(Twins);
    T:= Array(1..(Twins[nT]+1)/2, datatype=float[8]);
    for i from 1 to nT do T[(Twins[i]+1)/2]:= 1 od:
    TTwins:= Convolution(T,T);
    map(t -> 4*(t+1), select(n -> round(TTwins[n])=1,[$1..(nT+1)/2])); # Robert Israel, Jun 15 2014
  • PARI
    isok(isum1, vsum2) = {for (k=1, #vsum2, ksum2 = vsum2[k]; if (ksum2 > one, break;); if (isum1 - ksum2 != ksum2, if (vecsearch(vsum2, isum1 - ksum2), return (0)););); return (1);}
    lista() = {v = readvec("b014574.txt"); vsum1 = 4*v; vsum2 = 2*v; maxs2 = vecmax(vsum2); for (i=1, #v, isum1 = vsum1[i]; if (isum1 < maxs2, if (isok(isum1, vsum2), print1(isum1, ", "));););} \\ Michel Marcus, Jun 15 2014
    
  • PARI
    l1=l2=List();a=select(p->isprime(p+2),primes(1000));for(i=1,#a-1,if(i<#a/4,listput(l1,4*a[i]+4));for(j=i+1,#a,listput(l2,2*(a[i]+a[j])+4)));print(setminus(Set(l1),Set(l2))) \\ Lear Young, Jun 15 2014

A242880 Numbers that are both Poulet and Proth.

Original entry on oeis.org

1729, 4033, 8321, 12801, 65281, 130561, 348161, 3225601, 8355841, 8384513, 16773121, 40280065, 104988673, 2147418113, 4294901761, 4294967297, 53282340865, 68719214593, 137439477761, 1099510579201, 1911029760001, 2199021158401, 8796097216513, 281474959933441, 9007199388958721, 576460753377165313, 2305843011361177601, 18446744073709551617
Offset: 1

Author

Lear Young, May 25 2014

Keywords

Comments

Intersection of A080075 and A001567.
a(1) = 1729 is known as the Hardy-Ramanujan number (see A001235). - Omar E. Pol, Jun 14 2014

Crossrefs

Cf. A080075 (Proth numbers), A001567 (Poulet numbers).

Extensions

a(20)-a(28) from Max Alekseyev, May 28 2014

A242515 Numbers n such that 12n+1, 12n+5, 12n+7, 12n+11 are all composite numbers.

Original entry on oeis.org

44, 70, 72, 74, 105, 111, 112, 132, 137, 140, 147, 154, 163, 170, 182, 193, 202, 207, 209, 235, 245, 248, 252, 258, 262, 273, 285, 312, 315, 317, 322, 329, 331, 336, 345, 347, 349, 359, 369, 372, 377, 384, 392, 397, 403, 404, 422, 427, 437
Offset: 1

Author

Lear Young, May 16 2014

Keywords

Examples

			a(1) = 44; 44*12+1=529, 44*12+5=533, 44*12+7=535, 44*12+11=539, and 529, 533, 535 and 539 are all composites.
		

Crossrefs

Subsequence of A153383.

Programs

  • Mathematica
    Select[Range[500],AllTrue[12#+{1,5,7,11},CompositeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 13 2018 *)
  • PARI
    for(i=0,1000,if(!isprime(12*i+1) && !isprime(12*i+5) && !isprime(12*i+7) && !isprime(12*i+11),print1(i", "))) \\ Lear Young, May 16 2014

A241213 a(n) is built digit-by-digit (see comments for details).

Original entry on oeis.org

1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, 25, 30, 31, 32, 33, 34, 35, 40, 41, 42, 43, 44, 45, 100, 101, 102, 103, 104, 105, 110, 111, 112, 113, 114, 115, 120, 121, 122, 123, 124, 125, 130, 131, 132, 133, 134, 135, 140, 141, 142, 143, 144, 145
Offset: 1

Author

Lear Young, Apr 17 2014

Keywords

Comments

a(n) is built digit-by-digit as a_i ... a_3 a_2 a_1.
Note that in this case, the definition of "digit" is a nonnegative integer. If i > 3, the number of digits of a_i may be greater than 1.
Successively, we have:
a_1 = n mod 6;
a_2 = ((n - a_1)/primorial(2)) mod prime(2+1);
a_3 = ((n - a_1 - a_2*primorial(2))/primorial(3)) mod prime(3+1);
...
a_i = ((n - a_1 - a_2*primorial(2)-...-a_(i-1)*primorial(i-1))/primorial(i)) mod prime(i+1).
So that finally, n = a_1 + a_2*primorial(2) + ... + a_i*primorial(i).

Examples

			a(2287) = 10611.
10611 is built digit-by-digit as a_4 a_3 a_2 a_1 = 10 6 1 1.
And a_1 + a_2*primorial(2) + a_3*primorial(3) + a_4*primorial(4) = 1 + 1*6 + 6*30 + 10*210 = 2287.
(The definition of "digit" is a nonnegative integer. See comments for how to get a_1, a_2, a_3, a_4.)
		

Programs

  • Sage
    Pr = Primes()
    c = oeis(2110)[:10]
    def bjz(a):
        d = len(str(a)) + 1
        b  = [0] * (d)
        b[0] = a % 6
        s = 0
        for x in range(1, d):
            if x > 1:
                s += c[x] * b[x-1]
            b[x] = ((a - b[0] - s) / c[x+1] ) % Pr.unrank(x+1)
        return int(''.join(map(str, b[::-1])))
    [ bjz(x)  for x in range(1, 101)] # Lear Young, Apr 17 2014

A240718 Number of decompositions of 2n into an unordered sum of two primes, one of the two primes less than sqrt(2n-2).

Original entry on oeis.org

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

Author

Lear Young, Apr 11 2014

Keywords

Examples

			For n = 7, the a(7) = 1 solution is 2*7 = 3 + 11 = 7 + 7; one of these pairs, 3 + 11, contains a number less than sqrt(2*7 - 2).
		

Crossrefs

Cf. A002375.

Programs

  • Maple
    P:= NULL: A[1]:= 0: nextp:= 2:
    for n from 2 to 100 do
     while nextp^2 < 2*n-2 do
       P:= P, nextp;
       nextp:= nextprime(nextp);
     od;
     A[n]:= numboccur(true, map(t -> isprime(2*n-t), [P]))
    od:
    seq(A[i],i=1..100); # Robert Israel, Apr 30 2019
  • PARI
    a(n)=sum(i=2,primepi(floor(sqrt(2*n-2))),isprime(2*n-prime(i))) \\ Lear Young, Apr 11 2014

A239731 Difference between sum of first n primes and prime(prime(n)).

Original entry on oeis.org

-1, 0, -1, 0, -3, 0, -1, 10, 17, 20, 33, 40, 59, 90, 117, 140, 163, 218, 237, 286, 345, 390, 443, 502, 551, 614, 701, 784, 881, 976, 1011, 1112, 1215, 1330, 1417, 1550, 1665, 1780, 1923, 2056, 2203, 2360, 2485, 2660, 2827, 3010, 3141, 3252, 3455, 3670, 3879, 4090, 4307, 4484, 4717, 4932, 5147, 5400, 5631, 5876, 6135, 6362, 6555, 6830, 7125, 7424, 7633, 7922
Offset: 1

Author

Lear Young, Mar 30 2014

Keywords

Examples

			For n = 2 the a(2) = 0 solutions are prime(1) + prime(2) - prime(prime(2)) = 5 - 5 = 0.
		

Crossrefs

Programs

  • Maple
    A239731:=n->sum(ithprime(i), i=1..n) - ithprime(ithprime(n)); seq(A239731(n), n=1..50); # Wesley Ivan Hurt, Mar 30 2014
  • Mathematica
    Table[Sum[Prime[i], {i, n}] - Prime[Prime[n]], {n, 50}] (* Wesley Ivan Hurt, Mar 30 2014 *)
    #[[1]]-#[[2]]&/@Module[{nn=70,prs},prs=Accumulate[Prime[Range[nn]]];Thread[{prs,Prime[Prime[Range[nn]]]}]] (* Harvey P. Dale, Apr 10 2025 *)
  • PARI
    for(i = 1, 100, print1(sum(k = 1, i, prime(k)) - prime(prime(i))", ")) \\ Lear Young, Mar 30 2014
  • Sage
    [a - b for a, b in zip(oeis(7504)[1:], oeis(6450))] # Lear Young, Mar 30 2014
    

Formula

a(n) = A007504(n + 1) - A006450(n) = A007504(n + 1) - A000040(A000040(n)). - Wesley Ivan Hurt, Mar 30 2014
a(n) ~ (n^2 log n)/2. - Charles R Greathouse IV, Apr 08 2014

A226181 Primes p such that p-1 divided by the period of the binary expansion of 1/p equals 2^x for some nonnegative integer x.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 41, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 113, 131, 137, 139, 149, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 227, 233, 239, 257, 263, 269, 271, 281, 293, 311, 313, 317, 337, 347, 349
Offset: 1

Author

Lear Young, May 30 2013

Keywords

Comments

Equivalently, p-1 divided by the period of the decimal expansion of 1/p equals 2^x for some nonnegative integer x. Composite numbers satisfying this condition are given in A243050. - Lear Young, May 30 2013
Let pi_1(x) and pi(x) be the numbers of primes of this sequence and all primes not exceeding x, respectively. Then, for x>=3, p_1(x)/pi(x) >= C_Artin = 0.37395581... Numerical results suggest that it is likely lim pi_1(x)/pi(x) = 2*C_Artin. - Peter J. C. Moses and Vladimir Shevelev, May 29 2014

Examples

			(41-1)/20 = 2. 20 is the period of the binary representation of 1/n, the odd part of 2 is 1.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[2, 100]], # == 2^IntegerExponent[#, 2] &[(# - 1)/MultiplicativeOrder[2, #]] &] (* Peter J. C. Moses, May 28 2014 *)
  • PARI
    is(n) = {
      m = valuation(n+1,2);
          k=(n+1)>>m;
          if(k!=1, for(i=0,(n-1)>>1,
            l=valuation(k+n,2);
            k=(k+n)>>l;
            m+=l;if(k==1,break)));
           ((n-1)/m)>>valuation((n-1)/m, 2)==1
           \\ m  equals znorder(Mod(2,n))
        }
    forstep(i=3,1e3,2,if(is(i),print1(i, ", ")))
    \\ Lear Young May 30 2013
    
  • PARI
    forstep(i=1,1e3,2,j = (i-1)/znorder(Mod(2,i));if(j>>valuation(j, 2)==1,print1(i, ", "))) \\ Lear Young May 31 2013

A226014 Primes p such that A179382((p+1)/2) = (p-1)/(2^x) for some x>0.

Original entry on oeis.org

3, 7, 11, 13, 17, 19, 29, 31, 37, 41, 53, 59, 61, 67, 83, 97, 101, 107, 113, 127, 131, 137, 139, 149, 163, 173, 179, 181, 193, 197, 211, 227, 257, 269, 281, 293, 313, 317, 347, 349, 353, 373, 379, 389, 401, 409, 419, 421, 443, 449, 461, 467, 491, 509, 521, 523, 541, 547, 557, 563, 569, 577, 587, 593, 613, 617, 619, 653, 659, 661, 677, 701, 709, 757, 761, 769, 773, 787, 797, 809, 821, 827, 829, 853, 857, 859, 877, 883, 907, 929, 941, 947, 977
Offset: 1

Author

Lear Young, May 22 2013

Keywords

Comments

It is conjectured that:
Let n be an odd number and the period of 1/n is n-1 or a divisor of n-1. Call c=A179382((n+1)/2) the "cycle length of n". If c divides n-1 or n+1 = 2^x for some x>0, then n is prime. For details see link and Cf. - Lear Young, with contributions from Peter Košinár, Giovanni Resta, Charles R Greathouse IV, May 22 2013
The numbers in the sequence are the values of n in the above conjecture.

Examples

			929 : (929-1)/(2^2)=232=A179382((929+1)/2) and znorder(Mod(10,929))=464=(929-1)/2
		

Crossrefs

Cf. A179382, A136042 (both sequences related to the way to get the "cycle length of n").

Programs

  • PARI
    oddres(n)=n>>valuation(n, 2)
    cyc(d)=my(k=1, t=1); while((t=oddres(t+d))>1, k++); k
    forstep(n=3, 1e3, [4, 2, 2, 2], x=cyc(n);z=znorder(Mod(10, n));if((x==1 || (n%x==1 && oddres((n-1)/x)==1)) && (n%z==1 || n%z==0), print1(n", ")))
    \\ Charles R Greathouse IV, May 22 2013