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: Warut Roonguthai

Warut Roonguthai's wiki page.

Warut Roonguthai has authored 31 sequences. Here are the ten most recent ones:

A130230 Primes p == 5 (mod 8) such that the Diophantine equation x^2 - p*y^2 = -4 has a solution in odd integers x, y.

Original entry on oeis.org

5, 13, 29, 53, 61, 109, 149, 157, 173, 181, 229, 277, 293, 317, 397, 421, 461, 509, 541, 613, 653, 661, 733, 773, 797, 821, 853, 941, 1013, 1021, 1061, 1069, 1093, 1109, 1117, 1181, 1229, 1237, 1277, 1373, 1381, 1429, 1453, 1493, 1549, 1597
Offset: 1

Author

Warut Roonguthai, Aug 06 2007

Keywords

Comments

For the Diophantine equation x^2 - p*y^2 = -4 to have a solution in odd integers x, y we must have p == 5 (mod 8)
Calculated using Dario Alpern's quadratic Diophantine solver, see link.
Suggested by a discussion on the Number Theory Mailing List, circa Aug 01 2007.

Crossrefs

Cf. A130229.

A130229 Primes p == 5 (mod 8) such that the Diophantine equation x^2 - p*y^2 = -4 has no solution in odd integers x, y.

Original entry on oeis.org

37, 101, 197, 269, 349, 373, 389, 557, 677, 701, 709, 757, 829, 877, 997, 1213, 1301, 1613, 1861, 1901, 1949, 1973, 2069, 2221, 2269, 2341, 2357, 2621, 2797, 2837, 2917, 3109, 3181, 3301, 3413, 3709, 3797, 3821, 3853, 3877, 4013, 4021, 4093
Offset: 1

Author

Warut Roonguthai, Aug 06 2007

Keywords

Comments

For the Diophantine equation x^2 - p*y^2 = -4 to have a solution in odd integers x, y we must have p == 5 (mod 8).
Calculated using Dario Alpern's quadratic Diophantine solver, see link.
Suggested by a discussion on the Number Theory Mailing List, circa Aug 01 2007.

Crossrefs

Cf. A130230.

A117804 Natural position of n in the string 12345678910111213....

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120
Offset: 1

Author

Warut Roonguthai, Jul 23 2007

Keywords

Comments

The number of digits necessary to write down all the numbers 0, 1, 2, ..., n-1. Thus, the partial sums of A055642 are given by a(n+1). - Hieronymus Fischer, Jun 08 2012
From Daniel Forgues, Mar 21 2013: (Start)
From n = 10^0 + 1 to 10^1: a(n) - a(n-1) = 1 (9 * 10^0 terms);
From n = 10^1 + 1 to 10^2: a(n) - a(n-1) = 2 (9 * 10^1 terms);
From n = 10^2 + 1 to 10^3: a(n) - a(n-1) = 3 (9 * 10^2 terms);
...
From n = 10^k + 1 to 10^(k+1): a(n) - a(n-1) = k+1 (9 * 10^k terms). (End)
By the "number of digits" definition, a(n) = 1 + A058183(n-1) for n > 1. - David Fifield, Jun 02 2019

Examples

			12 begins at the 14th place in 12345678910111213... (we are ignoring "early bird" occurrences here, cf. A116700), so a(12) = 14.
From _Daniel Forgues_, Mar 21 2013: (Start)
a(10^1) = 10. (1*10^1 - 0)
a(10^2) = 190. (2*10^2 - 10)
a(10^3) = 2890. (3*10^3 - 110)
a(10^4) = 38890. (4*10^4 - 1110)
a(10^5) = 488890. (5*10^5 - 11110)
a(10^6) = 5888890. (6*10^6 - 111110)
...
a(10^k) = k*10^k - R_k + 1, R_k := k-th repunit (cf. A002275)
(the number of digits necessary to write down the numbers 0..10^k-1). (End)
		

Crossrefs

Formula

a(n) = d*n + 1 - (10^d - 1)/9 where d is the number of decimal digits in n, i.e., d = floor(log_10(n)) + 1.
From Hieronymus Fischer, Jun 08 2012: (Start)
a(n) = Sum_{j=0..n-1} A055642(j).
a(n) = 1 + A055642(n-1)*n - (10^A055642(n-1)-1)/9.
a(n) = 1 + A055642(n)*n - (10^A055642(n)-1)/9.
a(10^n) = (9*n-1)*(10^n-1)/9 + n + 1. (This is the total number of digits necessary to write down all the numbers with <= n places.)
G.f.: g(x) = x/(1-x) + (x/(1-x)^2)*Sum_{j>=0} x^10^j; corrected by Ilya Gutkovskiy, Jan 09 2017 (End)

A118537 Number of functions f: {1, 2, ..., n} --> {1, 2, ..., n} such that f(1) != f(2), f(2) != f(3), ..., f(n-1) != f(n), f(n) != f(1).

Original entry on oeis.org

2, 6, 84, 1020, 15630, 279930, 5764808, 134217720, 3486784410, 99999999990, 3138428376732, 106993205379060, 3937376385699302, 155568095557812210, 6568408355712890640, 295147905179352825840, 14063084452067724991026
Offset: 2

Author

Warut Roonguthai, May 06 2006

Keywords

Comments

a(n) is also the number of circuits of length n in the complete graph on n vertices. - Thibaut Lienart (syncthib(AT)gmail.com), Jan 29 2010
Circuits are allowed to be self-intersecting and are directional with a designated start node. The number of (self-avoiding) directed cycles is given by A124355. - Andrew Howroyd, Sep 05 2018
a(n) is also the number of graph colorings of the cycle graph C_n with n colors. - Orson R. L. Peters, Jul 27 2020

Crossrefs

Programs

  • Magma
    [(n-1)^n + (-1)^n*(n-1) : n in [2..20]]; // Wesley Ivan Hurt, Jul 27 2020
  • Mathematica
    a[n_]:=(n-1)^n + (-1)^n*(n-1); Array[a, 50, {2, 51}] (* Stefano Spezia, Sep 07 2018 *)
  • PARI
    a(n) = (n-1)^n + (-1)^n*(n-1); \\ Andrew Howroyd, Sep 05 2018
    

Formula

a(n) = (n-1)^n + (-1)^n*(n-1).

A051835 Palindromic Sophie Germain primes.

Original entry on oeis.org

2, 3, 5, 11, 131, 191, 12821, 14741, 19391, 19991, 36563, 38183, 93239, 96269, 1028201, 1074701, 1150511, 1178711, 1243421, 1281821, 1317131, 1333331, 1407041, 1456541, 1508051, 1532351, 1557551, 1598951, 1600061, 1609061
Offset: 1

Author

Warut Roonguthai Dec 11 1999

Keywords

Comments

p and 2p+1 are primes (cf. A005384) and p is a palindrome.

Crossrefs

Programs

  • Maple
    makepali:= proc(n, d) local L; # case with d odd
      L:= convert(n, base, 10);
      10^((d-1)/2)*n + add(L[i]*10^((d+1)/2-i), i=2..(d+1)/2)
    end proc:
    N:= 100: # for a(1)..a(N)
    R:= 2,3,5,11: count:= 4:
    for d from 3 by 2  while count < N do
      for i in [1,3,7,9] while count < N do
        for x from 0 to 10^((d-1)/2)-1 while count < N do
          y:= makepali(i*10^((d-1)/2)+x,d);
          if isprime(y) and isprime(2*y+1) then
            R:= R, y;
            count:= count+1;
           fi
    od od od:
    R; # Robert Israel, Nov 22 2020
  • Mathematica
    Select[Prime[Range[125000]],PrimeQ[2#+1]&&PalindromeQ[#]&] (* Harvey P. Dale, Nov 21 2021 *)

A030997 Smallest prime which is a concatenation of n consecutive primes.

Original entry on oeis.org

2, 23, 5711, 2357, 711131719, 113127131137139149, 29313741434753, 107109113127131137139149, 211223227229233239241251257, 691701709719727733739743751757, 2329313741434753596167
Offset: 1

Keywords

Examples

			a(5) = 711131719 is the smallest prime which is the concatenation of five consecutive primes 7, 11, 13, 17 and 19.
		

Crossrefs

Cf. A030461 (primes that are concatenations of two primes), A030469 (three primes), A030473 (four primes), A086041 (five primes).

Programs

  • PARI
    for(k=1,19, for(i=0,1e9, isprime( eval( p=concat( vector( k,j,Str( prime( i+j )))))) & break); print1(p,", ")) \\ M. F. Hasler, Nov 10 2009

A028916 Friedlander-Iwaniec primes: Primes of form a^2 + b^4.

Original entry on oeis.org

2, 5, 17, 37, 41, 97, 101, 137, 181, 197, 241, 257, 277, 281, 337, 401, 457, 577, 617, 641, 661, 677, 757, 769, 821, 857, 881, 977, 1097, 1109, 1201, 1217, 1237, 1297, 1301, 1321, 1409, 1481, 1601, 1657, 1697, 1777, 2017, 2069, 2137, 2281, 2389, 2417, 2437
Offset: 1

Keywords

Comments

John Friedlander and Henryk Iwaniec proved that there are infinitely many such primes.
A256852(A049084(a(n))) > 0. - Reinhard Zumkeller, Apr 11 2015
Primes in A111925. - Robert Israel, Oct 02 2015
Its intersection with A185086 is A262340, by the uniqueness part of Fermat's two-squares theorem. - Jonathan Sondow, Oct 05 2015
Cunningham calls these semi-quartan primes. - Charles R Greathouse IV, Aug 21 2017
Primes of the form (x^2 + y^2)/2, where x > y > 0, such that (x-y)/2 or (x+y)/2 is square. - Thomas Ordowski, Dec 04 2017
Named after the Canadian mathematician John Benjamin Friedlander (b. 1941) and the Polish-American mathematician Henryk Iwaniec (b. 1947). - Amiram Eldar, Jun 19 2021

Examples

			2 = 1^2 + 1^4.
5 = 2^2 + 1^4.
17 = 4^2 + 1^4 = 1^2 + 2^4.
		

Crossrefs

Cf. A000290, A000583, A000040, A256852, A256863 (complement), A002645 (subsequence), subsequence of A247857.
Primes of form n^2 + b^4, b fixed: A002496 (b = 1), A243451 (b = 2), A256775 (b = 3), A256776 (b = 4), A256777 (b = 5), A256834 (b = 6), A256835 (b = 7), A256836 (b = 8), A256837 (b = 9), A256838 (b = 10), A256839 (b = 11), A256840 (b = 12), A256841 (b = 13).

Programs

  • Haskell
    a028916 n = a028916_list !! (n-1)
    a028916_list = map a000040 $ filter ((> 0) . a256852) [1..]
    -- Reinhard Zumkeller, Apr 11 2015
  • Maple
    N:= 10^5: # to get all terms <= N
    S:= {seq(seq(a^2+b^4, a = 1 .. floor((N-b^4)^(1/2))),b=1..floor(N^(1/4)))}:
    sort(convert(select(isprime,S),list)); # Robert Israel, Oct 02 2015
  • Mathematica
    nn = 10000; t = {}; Do[n = a^2 + b^4; If[n <= nn && PrimeQ[n], AppendTo[t, n]], {a, Sqrt[nn]}, {b, nn^(1/4)}]; Union[t] (* T. D. Noe, Aug 06 2012 *)
  • PARI
    list(lim)=my(v=List([2]),t);for(a=1,sqrt(lim\=1),forstep(b=a%2+1, sqrtint(sqrtint(lim-a^2)), 2, t=a^2+b^4;if(isprime(t),listput(v,t)))); vecsort(Vec(v),,8) \\ Charles R Greathouse IV, Jun 12 2013
    

Extensions

Title expanded by Jonathan Sondow, Oct 02 2015

A027569 Initial members of prime decaplets (p, p+2, p+6, p+8, p+12, p+18, p+20, p+26, p+30, p+32).

Original entry on oeis.org

11, 33081664151, 83122625471, 294920291201, 573459229151, 663903555851, 688697679401, 730121110331, 1044815397161, 1089869189021, 1108671297731, 1235039237891, 1291458592421, 1738278660731
Offset: 1

Keywords

Comments

All terms are congruent to 11 (modulo 210). - Matt C. Anderson, May 28 2015

Crossrefs

Programs

  • Maple
    composite_small := proc (n::integer)
    description "procedure to determine if n has a prime factor less than 100";
    if igcd(2305567963945518424753102147331756070, n) = 1 then
    return false else return true end if;
    end proc;
    # begin initialization section
    p := [0, 2, 6, 8, 12, 18, 20, 26, 30, 32]; o := [1271, 1691]; m := 2310;
    # end initialization section
    with(ArrayTools); os := Size(o, 2); ps := Size(p, 2);
    loopstop := 10^11; loopstart := 0;
    print(11);
    for n from loopstart to loopstop do
    for a to os do
    counter := 0; wc := 0; wd := 0;
    while `and`(wd > -10, wd < ps) do
    wd := wd+1;
    if composite_small(m*n+o[a]+p[wd]) = false then wd := wd+1 else wd := -10 end if;
    end do;
    if wd >= 9 then while `and`(counter >= 0, wc < ps) do
    wc := wc+1;
    if isprime(m*n+o[a]+p[wc]) then counter := counter+1 else counter := -1 end if end do;
    end if;
    if counter = ps then print(m*n+o[a]); end if;
    end do;
    end do;
    # Matt C. Anderson, Apr 30 2015
  • PARI
    is(n)=isprime(n) && isprime(n+2) && isprime(n+6) && isprime(n+8) && isprime(n+12) && isprime(n+18) && isprime(n+20) && isprime(n+26) && isprime(n+30) && isprime(n+32)
    v=primes(10); t=1; forprime(p=31,1e11, v[t]=p; t=(t%10)+1; if(p-v[t]==32 && is(v[t]), print1(v[t]", "))) \\ Charles R Greathouse IV, May 20 2015
    
  • Perl
    use ntheory ":all"; say for sieve_prime_cluster(1,1e13, 2,6,8,12,18,20,26,30,32); # Dana Jacobsen, Sep 30 2015

A027570 Initial members of prime decaplets (p, p+2, p+6, p+12, p+14, p+20, p+24, p+26, p+30, p+32).

Original entry on oeis.org

9853497737, 21956291867, 22741837817, 164444511587, 179590045487, 217999764107, 231255798857, 242360943257, 666413245007, 696391309697, 867132039857, 974275568237, 976136848847, 1002263588297, 1086344116367
Offset: 1

Keywords

Comments

All terms are congruent to 167 (modulo 210). - Matt C. Anderson, May 29 2015

Crossrefs

Programs

  • Maple
    a := 1:
    for b to 25 do
    a := a*ithprime(b):
    end do:
    a;
    # now 'a' is the product of the primes less than 100.
    composite_small := proc (n::integer)
    description "procedure to determine if n has a prime factor less than 100";
    if igcd(2305567963945518424753102147331756070, n) = 1 then return false
    else return true;
    end if;
    end proc:
    # so composite_small tests if there are any factors 2 through 97.
    #begin initialization section
    p := [0, 2, 6, 12, 14, 20, 24, 26, 30, 32];
    o := [7517, 10247, 12137, 14447, 14867, 17177, 21377, 24107, 25997, 28727];
    m := 30030;
    #end initialization section
    # implement isprime(m*n+o+p)
    with(ArrayTools):
    os:=Size(o,2):
    ps:=Size(p,2):
    #here ps is 10 so a prime constellation of length 10.
    loopstop := 10^11:
    loopstart := 0:
    for n from loopstart to loopstop do
    for a to os do
    counter := 0; wc := 0; wd := 0;
      while `and`(wd > -10, wd < ps) do
      wd := wd+1;
      if composite_small(m*n+o[a]+p[wd]) = false then wd := wd+1
      else wd := -10 end if;
      end do;
    if wd >= 9 then
    while `and`(counter >= 0, wc < ps) do
      wc := wc+1;
      if isprime(m*n+o[a]+p[wc]) then counter := counter+1;
      else counter := -1
      end if;
    end do;
    end if;
    if counter = ps then print(m*n+o[a]) end if;
    end do:
    end do:
    # Matt C. Anderson, Apr 15 2015
  • Perl
    use ntheory ":all"; say for sieve_prime_cluster(1,1e13, 2,6,12,14,20,24,26,30,32); # Dana Jacobsen, Sep 30 2015

A030431 Primes of form 10n+3.

Original entry on oeis.org

3, 13, 23, 43, 53, 73, 83, 103, 113, 163, 173, 193, 223, 233, 263, 283, 293, 313, 353, 373, 383, 433, 443, 463, 503, 523, 563, 593, 613, 643, 653, 673, 683, 733, 743, 773, 823, 853, 863, 883, 953, 983, 1013, 1033, 1063, 1093, 1103, 1123, 1153, 1163, 1193
Offset: 1

Keywords

Comments

Also primes of form 5n+3.
Union of A132233, A132235, {3}. - Ray Chandler, Apr 07 2009
Primes p such that arithmetic mean of divisors of p^4 is an integer. There are 2 such sequences of primes, this one and A030430. - Ctibor O. Zizka, Oct 20 2009
5 is not quadratic residue of primes of this form. - Vincenzo Librandi, Jun 25 2014
Intersection of A000040 and A017305. - Iain Fox, Dec 30 2017

Crossrefs

Programs

Formula

a(n) = 10*A102338(n) + 3.

Extensions

Extended by Ray Chandler, Nov 07 2006