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.

Showing 1-3 of 3 results.

A081506 Primes of the form 2^k + 3^k + 4^k.

Original entry on oeis.org

3, 29, 353, 4889, 72353, 105312291668560568089831550410013687058921146068446092937783402353
Offset: 1

Views

Author

Labos Elemer, Apr 15 2003

Keywords

Comments

The next term (a(7)) has 202 digits. - Harvey P. Dale, Aug 20 2015

Examples

			k = 2: 2^2 + 3^2 + 4^2 = 4 + 9 + 16 = 29, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Do[s=2^w+3^w+4^w; If[IntegerQ[w/100], Print[{w}]]; If[PrimeQ[s], Print[{w, s}]], {w, 0, 1000}]
    Select[Table[2^n+3^n+4^n,{n,0,200}],PrimeQ] (* Harvey P. Dale, Aug 20 2015 *)
  • PARI
    lista(kmax) = {my(p); for(k = 0, kmax, p = 2^k + 3^k + 4^k; if(isprime(p), print1(p, ", ")));} \\ Amiram Eldar, Aug 17 2024

Formula

a(n) = A074526(A081507(n)). - Amiram Eldar, Aug 17 2024

A137786 a(n) = 4^n - 3^n - 2^n.

Original entry on oeis.org

-1, -1, 3, 29, 159, 749, 3303, 14069, 58719, 241949, 988503, 4015109, 16241679, 65506349, 263636103, 1059360149, 4251855039, 17050597949, 68331794103, 273715121189, 1096023794799, 4387584060749, 17560800790503, 70274592610229, 281192530396959, 1125052584678749
Offset: 0

Views

Author

Keywords

Comments

a(n) mod 100 = 49 for n = 4*k + 1, k > 0; a(n) mod 100 = 3 for n = 4*k + 2, k >= 0. [Alex Ratushnyak, Jul 03 2012]

Crossrefs

Programs

  • Magma
    I:=[-1,-1,3]; [n le 3 select I[n] else 9*Self(n-1)-26*Self(n-2)+24*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Feb 12 2014
  • Maple
    A137786:=n->4^n - 3^n - 2^n; seq(A137786(n), n=0..25); # Wesley Ivan Hurt, Feb 10 2014
  • Mathematica
    Table[4^n - 3^n - 2^n, {n, 0, 25}] (* Bruno Berselli, Jul 04 2012 *)
    LinearRecurrence[{9,-26,24},{-1,-1,3},30] (* Harvey P. Dale, Sep 19 2012 *)
    CoefficientList[Series[-(1 - 8 x + 14 x^2)/((1 - 2 x) (1 - 3 x) (1 - 4 x)), {x, 0, 40}], x] (* Vincenzo Librandi, Feb 12 2014 *)
  • PARI
    a(n) = 4^n-3^n-2^n; \\ Joerg Arndt, Jul 04 2012
    
  • Python
    print([4**n - 3**n - 2**n for n in range(99)])
    # Alex Ratushnyak, Jul 03 2012
    

Formula

G.f.: -(1-8*x+14*x^2)/((1-2*x)*(1-3*x)*(1-4*x)). - Bruno Berselli, Jul 04 2012
a(0)=-1, a(1)=-1, a(2)=3, a(n) = 9*a(n-1) - 26*a(n-2) + 24*a(n-3). - Harvey P. Dale, Sep 19 2012
E.g.f.: exp(2*x)*(exp(2*x) - exp(x) - 1). - Elmo R. Oliveira, Sep 12 2024

Extensions

Offset set to 0, terms corrected, more terms added by Alex Ratushnyak, Jul 03 2012.

A299145 Primes of the form j^k + (j-1)^k + ... + 2^k, for j > 1 and k > 0.

Original entry on oeis.org

2, 5, 13, 29, 97, 139, 353, 4889, 72353, 353815699, 42065402653, 84998999651, 102769130749, 15622297824266188673, 28101527071305611527, 20896779938941631284493075599148668795944697935466419104293, 105312291668560568089831550410013687058921146068446092937783402353
Offset: 1

Views

Author

Gionata Neri, Feb 03 2018

Keywords

Comments

Except for the terms 2, 5, 13, 29, 139, the exponent k satisfies k >= 4. More generally, if Q(j) = j^k + (j-1)^k + ... + 2^k is a term, then j-1 is a divisor of A064538(k). This is because (j-1) is a factor of Q(j) and thus Q(j) is prime only if j-1 is a divisor of the denominator of Q(j), i.e. A064538(k). Thus for each k there is only a finite number of values of j to check. This provides an efficient algorithm to find terms of this sequence by looking only for primes in the numbers H_{j,-k} - 1 = j^k + (j-1)^k + ... + 2^k for j-1 a divisor of A064538(k). - Chai Wah Wu, Mar 06 2018

Examples

			2 = 2^1;
5 = 3^1 + 2^1;
13 = 3^2 + 2^2;
29 = 4^2 + 3^2 + 2^2;
97 = 3^4 + 2^4;
139 = 7^2 + 6^2 + 5^2 + 4^2 + 3^2 + 2^2;
353 = 4^4 + 3^4 + 2^4;
4889 = 4^6 + 3^6 + 2^6;
72353 = 4^8 + 3^8 + 2^8;
		

Crossrefs

Programs

  • Mathematica
    With[{nn = 350}, Sort@ Flatten@ Map[Select[#, PrimeQ] &, Table[Total[Range[j, 1, -1]^k] - 1, {j, 2, nn}, {k, nn - j}]]] (* Michael De Vlieger, Feb 03 2018 *)
  • PARI
    limit=100000; v=vector(limit); for(n=1, ceil((-1+(1+8*limit)^(1/2))/2), for(k=1, logint(limit, n+0^(n-1)), a=sum(i=1,n,i^k)-1;if(isprime(a)&&a
    				

Extensions

a(10)-a(15) from Michael De Vlieger, Feb 03 2018
a(16)-a(17) from Chai Wah Wu, Mar 07 2018
Showing 1-3 of 3 results.