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: Amir H. Farrahi

Amir H. Farrahi's wiki page.

Amir H. Farrahi has authored 5 sequences.

A185949 Smallest prime ending in 10^n+1 in its base-10 representation.

Original entry on oeis.org

11, 101, 21001, 1810001, 2100001, 61000001, 2010000001, 11100000001, 61000000001, 1810000000001, 14100000000001, 151000000000001, 5010000000000001, 9100000000000001, 271000000000000001, 1110000000000000001, 24100000000000000001, 261000000000000000001, 3910000000000000000001, 11100000000000000000001
Offset: 1

Author

Amir H. Farrahi, Feb 07 2011

Keywords

Programs

  • Maple
    f:= proc(n) local p;
      for p from 10^n+1 by 10^(n+1) do
        if isprime(p) then return p fi
      od
    end proc:
    map(f, [$1..30]); # Robert Israel, May 03 2018
  • Mathematica
    Table[k=0; While[!PrimeQ[p=FromDigits[Join[IntegerDigits[k], IntegerDigits[10^n+1]]]], k++]; p, {n,20}]
  • Python
    from sympy import isprime as is_prime
    # This implementation assumes function is_prime(n)
    # returns True if n is prime, or False otherwise:
    for n in range (1, 100):
        pattern = 10**n + 1
        for j in range (0, 10000000):
            if (j == 0):
                num = "%d" % (pattern)
            else:
                num = "%d%d" % (j, pattern)
            if (is_prime(int(num))):
                print(num)
                break

A185940 a(n) = 1 - 2^(n+1) + 3^(n+2).

Original entry on oeis.org

24, 74, 228, 698, 2124, 6434, 19428, 58538, 176124, 529394, 1590228, 4774778, 14332524, 43013954, 129074628, 387289418, 1161999324, 3486260114, 10459304628, 31378962458, 94138984524, 282421147874, 847271832228, 2541832273898, 7625530376124, 22876658237234
Offset: 1

Author

Amir H. Farrahi, Feb 06 2011

Keywords

Crossrefs

Programs

  • Magma
    [1 - 2^(n+1) + 3^(n+2): n in [1..40]]; // Vincenzo Librandi, Apr 05 2011
    
  • Maple
    A185940:=n->1-2^(n+1)+3^(n+2): seq(A185940(n), n=1..40); # Wesley Ivan Hurt, Jul 23 2017
  • Mathematica
    CoefficientList[Series[-2*x*(12 - 35*x + 24*x^2)/(-1 + 6*x - 11*x^2 + 6*x^3), {x,0,50}], x] (* or *) LinearRecurrence[{6, -11, 6}, {24, 74, 228}, 50] (* G. C. Greubel, Feb 25 2017 *)
  • PARI
    x='x+O('x^50); Vec(-2*x*(12 - 35*x + 24*x^2) / (-1 + 6*x - 11*x^2 + 6*x^3)) \\ G. C. Greubel, Feb 25 2017

Formula

a(n) = 1 - A000079(n+1) + A000244(n+2)
From Alexander R. Povolotsky, Jan 07 2011: (Start)
G.f.: 2*x*(12 - 35*x + 24*x^2) / (1 - 6*x + 11*x^2 - 6*x^3)
a(n+2) = -6*a(n) + 5*a(n+1)+2. (End)
a(n) = 6*a(n-1) - 11*a(n-2) + 6*a(n-3). - G. C. Greubel, Feb 25 2017
E.g.f.: exp(x) - 2*exp(2*x) + 9*exp(3*x) - 8. - G. C. Greubel, Jul 23 2017

Extensions

Corrected and edited by Bruno Berselli, Apr 04 2011

A185939 a(n) = 9*n^2 - 6*n + 2.

Original entry on oeis.org

5, 26, 65, 122, 197, 290, 401, 530, 677, 842, 1025, 1226, 1445, 1682, 1937, 2210, 2501, 2810, 3137, 3482, 3845, 4226, 4625, 5042, 5477, 5930, 6401, 6890, 7397, 7922, 8465, 9026, 9605, 10202, 10817, 11450
Offset: 1

Author

Amir H. Farrahi, Feb 06 2011

Keywords

Comments

Group the set of natural numbers in set of 3 (1, 2, 3; 4, 5, 6; 7, 8, 9; ...) In each group, multiply the first two numbers and then add the third number to the result to get the corresponding entry in our sequence.

Programs

  • Mathematica
    CoefficientList[Series[-x*(x + 5)*(2*x + 1)/(x - 1)^3, {x,0,50}], x] (* or *) LinearRecurrence[{3, -3, 1}, {5, 26, 65}, 50] (* G. C. Greubel, Feb 25 2017 *)
    Table[9n^2-6n+2,{n,40}] (* or *) #[[1]]#[[2]]+#[[3]]&/@Partition[Range[111],3]  (* Harvey P. Dale, Apr 08 2022 *)
  • PARI
    x='x+O('x^50); Vec(-x*(x+5)*(2*x+1)/(x-1)^3) \\ G. C. Greubel, Feb 25 2017

Formula

G.f. -x*(x+5)*(2*x+1) / (x-1)^3 . - Alexander R. Povolotsky, Feb 06 2011
a(n) = a(n-1) + 18*n - 15, a(1) = 5. - Vincenzo Librandi, Feb 07 2011
a(n) = (2*n-1)^2 + (2*n)^2 + (n-1)^2. - Bruno Berselli, Feb 06 2012
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - G. C. Greubel, Feb 25 2017
E.g.f.: (9*x^2 + 3*x + 2)*exp(x) - 2. - G. C. Greubel, Jul 23 2017

A185826 Sum of the next n natural numbers raised to the n-th power.

Original entry on oeis.org

1, 25, 3375, 1336336, 1160290625, 1870414552161, 5026507568359375, 20882706457600000000, 126834469112674289266929, 1078732544346879404306640625, 12415028528548173886807771291871, 188031682201497672618081000000000000, 3661926425131437024691115607984619140625
Offset: 1

Author

Amir H. Farrahi, Feb 05 2011

Keywords

Comments

Write the natural numbers in groups, with group sizes incremented by one, each time: 1; 2,3; 4,5,6; 7,8,9,10; ... and add the numbers in each group, then take the i-th power for the i-th group to get the i-th entry in the sequence.

Crossrefs

Cf. A006003.

Programs

  • Mathematica
    Module[{nn=15},#[[1]]^#[[2]]&/@Thread[{Total/@TakeList[Range[(nn(nn+1))/2],Range[ nn]],Range[nn]}]] (* or *) Table[((n+n^3)/2)^n,{n,20}] (* Harvey P. Dale, Apr 24 2022 *)
  • Python
    num = 100
    n = 0
    a = []
    for i in range(1, num):
        sum = 0
        for j in range(1, i+1):
            sum = sum + (n+j)
        n = n + i
        a.append(sum**i)

Formula

a(n) = A006003(n)^n.
a(n) = ((n + n^3)/2)^n. - Harvey P. Dale, Apr 24 2022

Extensions

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

A181428 a(n) = prime(n+2) + prime(n+1) - prime(n).

Original entry on oeis.org

6, 9, 13, 17, 19, 23, 25, 33, 37, 39, 47, 47, 49, 57, 65, 67, 69, 77, 77, 81, 89, 93, 103, 109, 107, 109, 113, 115, 131, 145, 141, 145, 151, 161, 159, 169, 173, 177, 185, 187, 193, 203, 199, 203, 213, 235, 239, 233, 235, 243, 247, 253, 267, 269, 275, 277, 279, 287, 287, 295, 317, 325, 317, 319, 335, 351, 353
Offset: 1

Author

Amir H. Farrahi, Jan 29 2011

Keywords

Programs

  • Maple
    A181428 := proc(n)
        ithprime(n+1)-ithprime(n)+ithprime(n+2) ;
    end proc:
    seq(A181428(n),n=1..80) ; # R. J. Mathar, Sep 10 2016
  • Mathematica
    #[[3]]+#[[2]]-#[[1]]&/@Partition[Prime[Range[100]],3,1]  (* Harvey P. Dale, Feb 01 2011 *)
    ListConvolve[{1, 1, -1}, Prime[Range[100]]]
  • PARI
    first(n)=my(v=primes(n+2)); for(k=1,n, v[k]=v[k+2]+v[k+1]-v[k]); v[1..n] \\ Charles R Greathouse IV, Feb 23 2017