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-4 of 4 results.

A080075 Proth numbers: of the form k*2^m + 1 for k odd, m >= 1 and 2^m > k.

Original entry on oeis.org

3, 5, 9, 13, 17, 25, 33, 41, 49, 57, 65, 81, 97, 113, 129, 145, 161, 177, 193, 209, 225, 241, 257, 289, 321, 353, 385, 417, 449, 481, 513, 545, 577, 609, 641, 673, 705, 737, 769, 801, 833, 865, 897, 929, 961, 993, 1025, 1089, 1153, 1217, 1281, 1345, 1409
Offset: 1

Views

Author

Eric W. Weisstein, Jan 24 2003

Keywords

Comments

A Proth number is a square iff it is of the form (2^(m-1)+-1)*2^(m+1)+1 = 4^m+-2^(m+1)+1 = (2^m+-1)^2 for m > 1. See A086341. - Thomas Ordowski, Apr 22 2019

Crossrefs

Programs

  • Mathematica
    Select[Range[3, 1500, 2], And[OddQ[#[[1]] ], #[[-1]] >= 1, 2^#[[-1]] > #[[1]] ] &@ Append[QuotientRemainder[#1, 2^#2], #2] & @@ {#, IntegerExponent[#, 2]} &[# - 1] &] (* Michael De Vlieger, Nov 04 2019 *)
  • PARI
    is_A080075 = isproth(x)={!bittest(x--,0) && (x>>valuation(x+!x,2))^2 < x } \\ M. F. Hasler, Aug 16 2010; edited by Michel Marcus, Apr 23 2019, M. F. Hasler, Jul 07 2022
    
  • PARI
    next_A080075(N)=N+2^(exponent(N)\2+1)
    A080075_first(N)=vector(N,i,if(i>1,next_A080075(N),3)) \\ M. F. Hasler, Jul 07 2022
    
  • Python
    from itertools import count, islice
    def A080075_gen(startvalue=3): # generator of terms >= startvalue
        return filter(lambda n:(n-1&-n+1)**2+1>=n,count(max(startvalue,3)))
    A080075_list = list(islice(A080075_gen(),30)) # Chai Wah Wu, Oct 06 2024

Formula

a(n) = A116882(n+1)+1. - Klaus Brockhaus, Georgi Guninski and M. F. Hasler, Aug 16 2010
a(n) = A157892(n)*2^A157893(n) + 1. - M. F. Hasler, Aug 16 2010
a(n) ~ n^2/2. - Thomas Ordowski, Oct 19 2014
Sum_{n>=1} 1/a(n) = 1.09332245643583252894473574405304699874426408312553... (Borsos et al., 2022). - Amiram Eldar, Jan 29 2022
a(n+1) = a(n) + 2^round(L(n)/2), where L(n) is the number of binary digits of a(n); equivalently, floor(log_2(a(n))/2 + 1) in the exponent. [Lemma 2.2 in Borsos et al.] - M. F. Hasler, Jul 07 2022

A201455 a(n) = 3*a(n-1) + 4*a(n-2) for n>1, a(0)=2, a(1)=3.

Original entry on oeis.org

2, 3, 17, 63, 257, 1023, 4097, 16383, 65537, 262143, 1048577, 4194303, 16777217, 67108863, 268435457, 1073741823, 4294967297, 17179869183, 68719476737, 274877906943, 1099511627777, 4398046511103, 17592186044417, 70368744177663, 281474976710657
Offset: 0

Views

Author

Bruno Berselli, Jan 09 2013

Keywords

Comments

This is the Lucas sequence V(3,-4).
Inverse binomial transform of this sequence is A087451.

Crossrefs

Cf. for the same recurrence with initial values (i,i+1): A015521 (Lucas sequence U(3,-4); i=0), A122117 (i=1), A189738 (i=3).
Cf. for similar closed form: A014551 (2^n+(-1)^n), A102345 (3^n+(-1)^n), A087404 (5^n+(-1)^n).

Programs

  • Magma
    [n le 1 select n+2 else 3*Self(n)+4*Self(n-1): n in [0..25]];
    
  • Mathematica
    RecurrenceTable[{a[n] == 3 a[n - 1] + 4 a[n - 2], a[0] == 2, a[1] == 3}, a[n], {n, 25}]
  • Maxima
    a[0]:2$ a[1]:3$ a[n]:=3*a[n-1]+4*a[n-2]$ makelist(a[n], n, 0, 25);
    
  • PARI
    Vec((2-3*x)/((1+x)*(1-4*x)) + O(x^30)) \\ Michel Marcus, Jun 26 2015

Formula

G.f.: (2-3*x)/((1+x)*(1-4*x)).
a(n) = 4^n+(-1)^n.
a(n) = A086341(A047524(n)) for n>0, a(0)=2.
a(n) = [x^n] ( (1 + 3*x + sqrt(1 + 6*x + 25*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015
a(n) = (2/4^n) * Sum_{k = 0..n} binomial(4*n+1, 4*k). - Peter Bala, Feb 06 2019

A097581 a(n) = 3*2^floor((n-1)/2) + (-1)^n.

Original entry on oeis.org

2, 4, 5, 7, 11, 13, 23, 25, 47, 49, 95, 97, 191, 193, 383, 385, 767, 769, 1535, 1537, 3071, 3073, 6143, 6145, 12287, 12289, 24575, 24577, 49151, 49153, 98303, 98305, 196607, 196609, 393215, 393217, 786431, 786433, 1572863, 1572865
Offset: 1

Views

Author

Pierre CAMI, Sep 20 2004

Keywords

Comments

Previous name was: a(1)=2 then if n even a(n)=a(n-1)+2 and if n odd a(n)=a(n-2)+a(n-1)-1.
This sequence a(n)=A016116(n-1)+A086341(n). Generalization: starting with a(1) even then if n even a(n)=a(n-1)+2 and if n odd a(n)=a(n-2)+a(n-1)-1 you get a new sequence as a(1) increases. But if a(1) is odd, you get always the same sequence with only less values as a(1) increases. If a(1) is even, the sequence difference between two sequences with different but consecutive a(1) is the sequence of powers of 2 = 2,2,4,4,8,8,16,16,32,32,......

Examples

			Starting with a(1)=4 the new sequence is 4,6,9,11,19,21,39,41,79,81,159,161
The sequence difference between sequence starting with a(1)=4 and the sequence starting with a(1)=2 is 2,2,4,4,8,8,16,16,32,32,64,64,.......
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{-1,2,2},{2,4,5},40] (* Harvey P. Dale, Aug 10 2011 *)
    Table[3*2^(Floor[(n - 1)/2]) + (-1)^n, {n, 1,50}] (* G. C. Greubel, Apr 18 2017 *)
  • PARI
    a(n)=3*2^floor((n-1)/2)+(-1)^n

Formula

From R. J. Mathar, Nov 13 2009: (Start)
a(n) = -a(n-1) + 2*a(n-2) + 2*a(n-3).
G.f.: x*(2+6*x+5*x^2)/((1+x)*(1-2*x^2)). (End)

Extensions

Equation in the comment corrected by R. J. Mathar, Nov 13 2009
Better name from Ralf Stephan, Aug 19 2013

A344851 a(n) = (n^2) mod (2^A070939(n)).

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 16, 25, 4, 17, 0, 17, 4, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 0, 17, 36, 57, 16, 41, 4, 33, 0, 33, 4, 41, 16, 57, 36, 17, 0, 49, 36, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
Offset: 0

Views

Author

Rémy Sigrist, May 30 2021

Keywords

Comments

Informally, if n has w binary digits, a(n) is obtained by keeping the w final binary digits of n^2.
For n > 0, a(n) is the final digit of n^2 in base A062383(n).
This sequence has interesting graphical features (see illustration in Links section).

Examples

			For n = 42:
- A070939(42) = 6,
- a(42) = (42^2) mod (2^6) = 1764 mod 64 = 36.
		

Crossrefs

Cf. A000290, A048152, A062383, A070939, A086341, A116882, A316347 (decimal analog).

Programs

  • Mathematica
    {0}~Join~Table[Mod[n^2,2^(1+Floor@Log2@n)],{n,100}] (* Giorgos Kalogeropoulos, Jun 02 2021 *)
  • PARI
    a(n) = (n^2) % 2^#binary(n)
    
  • Python
    def a(n): return (n**2) % (2**n.bit_length())
    print([a(n) for n in range(75)]) # Michael S. Branicky, May 30 2021

Formula

a(n) = 0 iff n = 0 or n > 1 and n belongs to A116882.
a(n) = 1 iff n belongs to A086341.
a(2^k + m) = a(2^(k+1)-m) for any k > 0 and m = 0..2^k.
Showing 1-4 of 4 results.