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

A271225 a(n) = (A268924(n)^2 + 2)/3^n, n >= 0.

Original entry on oeis.org

2, 1, 2, 18, 6, 2, 354, 118, 1107, 369, 123, 41, 239803, 495074, 3475362, 1158454, 7887171, 2629057, 56207062, 246253281, 82084427, 5389722857, 25755119139, 8585039713, 53195580742, 193589999521
Offset: 0

Views

Author

Wolfdieter Lang, Apr 05 2016

Keywords

Comments

a(n) is an integer because b(n) = A268924(n) satisfies b(n)^2 + 2 == 0 (mod 3^n), n >= 0.
See A268924 for details, links and references.

Examples

			a(0) = (0^2 + 2)/1 = 2.
a(4) = (22^2 + 2)/3^4 = 6.
		

Crossrefs

Cf. A268924, A271223, A271226 (companion sequence).

Programs

  • PARI
    b(n) = 3^n - truncate(sqrt(-2+O(3^(n))));
    a(n) = (b(n)^2 + 2)/3^n; \\ Michel Marcus, Apr 09 2016

Formula

a(n) = (b(n)^2 + 2)/3^n, n >= 0, with b(n) = A268924(n).

A006267 Continued cotangent for the golden ratio.

Original entry on oeis.org

1, 4, 76, 439204, 84722519070079276, 608130213374088941214747405817720942127490792974404
Offset: 0

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    a := proc(n) option remember; if n = 1 then 4 else a(n-1)^3 + 3*a(n-1) end if; end: seq(a(n), n = 1..5); # Peter Bala, Nov 15 2022
  • Mathematica
    c = N[GoldenRatio, 1000]; Table[Round[c^(3^n)], {n, 1, 8}] (* Artur Jasinski, Sep 22 2008 *)
    a = {}; x = 4; Do[AppendTo[a, x]; x = x^3 + 3 x, {n, 1, 10}]; a (* Artur Jasinski, Sep 24 2008 *)
  • PARI
    a(n)=fibonacci(3^n+1) + fibonacci(3^n-1) \\ Andrew Howroyd, Dec 30 2024
    
  • PARI
    a(n)={my(t=1); for(i=1, n, t = t^3 + 3*t); t} \\ Andrew Howroyd, Dec 30 2024

Formula

(1+sqrt(5))/2 = cot(Sum_{n>=0} (-1)^n*acot(a(n))); let b(0) = (1+sqrt(5))/2, b(n) = (b(n-1)*floor(b(n-1))+1)/(b(n-1)-floor(b(n-1))) then a(n) = floor(b(n)). - Benoit Cloitre, Apr 10 2003
a(n) = A000204(3^n). - Benoit Cloitre, Sep 18 2005
a(n) = round(c^(3^n)) where c = GoldenRatio = 1.6180339887498948482... = (sqrt(5)+1)/2 (A001622). - Artur Jasinski, Sep 22 2008
a(n) = a(n-1)^3 + 3*a(n-1), a(0) = 1. - Artur Jasinski, Sep 24 2008
a(n+1) = Product_{k = 0..n} A002813(k). Thus a(n) divides a(n+1). - Peter Bala, Nov 22 2012
Sum_{n>=0} a(n)^2/A045529(n+1) = 1. - Amiram Eldar, Jan 12 2022
a(n) = Product_{k=0..n-1} (Lucas(2*3^k) + 1) (Usiskin, 1973). - Amiram Eldar, Jan 29 2022
From Peter Bala, Nov 15 2022: (Start)
a(n) = Lucas(3^n) for n >= 1.
a(n) == 1 (mod 3) for n >= 1.
a(n+1) == a(n) (mod 3^(n+1)) for n >= 1 (a particular case of the Gauss congruences for the Lucas numbers).
The smallest positive residue of a(n) mod 3^n = A268924(n).
In the ring of 3-adic integers the limit_{n -> oo} a(n) exists and is equal to A271223. Cf. A006266. (End)

Extensions

The next term is too large to include.

A002249 a(n) = a(n-1) - 2*a(n-2) with a(0) = 2, a(1) = 1.

Original entry on oeis.org

2, 1, -3, -5, 1, 11, 9, -13, -31, -5, 57, 67, -47, -181, -87, 275, 449, -101, -999, -797, 1201, 2795, 393, -5197, -5983, 4411, 16377, 7555, -25199, -40309, 10089, 90707, 70529, -110885, -251943, -30173, 473713, 534059, -413367, -1481485
Offset: 0

Views

Author

Keywords

Comments

4*2^n = A002249(n)^2 + 7*A001607(n)^2. See A077020, A077021.
Among presented initial elements of the sequence a(n), the maximal increasing or decreasing subsequences have length either 3 or 4. - Roman Witula, Aug 21 2012
This is the Lucas Sequence V_n(P, Q) = V_n(1, 2). U_n(1, 2) = A107920(n). - Raphie Frank, Dec 25 2013
The only numbers that occur more than once are 1=a(1)=a(4) and -5=a(3)=a(9). See Noam D. Elkies's posting in the Mathematics Stack Exchange link. - Robert Israel, Dec 21 2016

Examples

			We have a(2)-a(7) = a(5)-a(4) = a(6)+a(4) = a(11)-a(10) = a(12)+a(10)=10. Further the following relations: ((1+i*sqrt(7))/2)^4 + ((1-i*sqrt(7))/2)^4 = 1 and ((1+i*sqrt(7))/2)^8 + ((1-i*sqrt(7))/2)^8 = -31. - _Roman Witula_, Aug 21 2012
G.f. = 2 + x - 3*x^2 - 5*x^3 + x^4 + 11*x^5 + 9*x^6 - 13*x^7 - 31*x^8 + ...
From _Raphie Frank_, Dec 05 2015: (Start)
V_n(1, 2) = a(1*n) = ((a(1) + sqrt(-7))/2)^n + ((a(1) - sqrt(-7))/2)^n; a(1) = 1.
V_n(-3, 4) = a(2*n) = ((a(2) + sqrt(-7))/2)^n + ((a(2) - sqrt(-7))/2)^n; a(2) = -3.
V_n(-5, 8) = a(3*n) = ((a(3) + sqrt(-7))/2)^n + ((a(3) - sqrt(-7))/2)^n; a(3) = -5.
V_n(11, 32) = a(5*n) = ((a(5) + sqrt(-7))/2)^n + ((a(5) - sqrt(-7))/2)^n; a(5) = 11.
V_n(-181, 8192) = a(13*n) = ((a(13) + sqrt(-7))/2)^n + ((a(13) - sqrt(-7))/2)^n; a(13) = -181.
(End)
		

Crossrefs

Programs

  • Magma
    I:=[2,1]; [n le 2 select I[n] else Self(n-1)-2*Self(n-2): n in [1..50]]; // Vincenzo Librandi, Nov 29 2015
    
  • Maple
    A002249 := proc(n) option remember; >if n = 1 then 1 elif n = 2 then -3 else A002249(n-1>)-2*A002249(n-2); fi; end;
  • Mathematica
    LinearRecurrence[{1,-2}, {2,1}, 50] (* Roman Witula, Aug 21 2012 *)
    a[ n_] := 2^(n/2) ChebyshevT[ n, 8^(-1/2)] 2; (* Michael Somos, Jun 02 2014 *)
    a[ n_] := 2^Min[0, n] SeriesCoefficient[ (2 - x) / (1 - x + 2 x^2), {x, 0, Abs @ n}]; (* Michael Somos, Jun 02 2014 *)
    Table[2 Re[((1 + I Sqrt[7])/2)^n], {n, 0, 40}] (* Jean-François Alcover, Jun 02 2017 *)
  • PARI
    {a(n) = if( n<0, 2^n * a(-n), polsym(2 - x + x^2, n)[n+1])}; /* Michael Somos, Jun 02 2014 */
    
  • PARI
    {a(n) = 2 * real( ((1 + quadgen(-28)) / 2)^n )}; /* Michael Somos, Jun 02 2014 */
    
  • PARI
    x='x+O('x^100); Vec((2-x)/(1-x+2*x^2)) \\ Altug Alkan, Dec 04 2015
    
  • Python
    from sympy import sqrt, re, I
    def a(n): return 2*re(((1 + I*sqrt(7))/2)**n)
    print([a(n) for n in range(40)]) # Indranil Ghosh, Jun 02 2017
  • Sage
    [lucas_number2(n,1,2) for n in range(0, 40)] # Zerinvary Lajos, Apr 30 2009
    

Formula

G.f.: (2-x)/(1-x+2x^2). - Michael Somos, Oct 18 2002
a(n) = trace(A^n) for the square matrix A=[1, -2; 1, 0]. - Paul Barry, Sep 05 2003
a(n) = 2^((n+2)/2)*cos(-n*acot(sqrt(7)/7)). - Paul Barry, Sep 06 2003
a(n) = (-1)^n*(2*A110512(n) - A001607(n)) = ((1 + i*sqrt(7))/2)^n + ((1 - i*sqrt(7))/2)^n. - Roman Witula, Aug 21 2012
G.f.: G(0), where G(k) = 1 + 1/(1 - x*(7*k+1)/(x*(7*k+8) + 2/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 03 2013
(a(A060728(n) - 2))^2 = (A107920(2*(A060728(n)) - 4))^2 = 2^(A060728(n)) - 7 = A227078(n), the Ramanujan-Nagell squares. - Raphie Frank, Dec 25 2013
a(n) = [x^n] ( (1 + x + sqrt(1 + 2*x - 7*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015
a(n) = (A107920(n+1) + 2*A107920(n+2) - A107920(n+3))/2. - Raphie Frank, Nov 28 2015
V_n(P,Q) = a(k*n) = ((a(k) + sqrt(-7))/2)^n + ((a(k) - sqrt(-7))/2)^n for k is in {1, 2, 3, 5, 13} = (A060728(n) - 2), P is in {1, -3, -5, 11, -181} = a(k), and Q is in {2, 4, 8, 32, 8192} = 2^k = (2*A076046(n) + 2) = (A227078(n) - 7)/4. P^2 - 4*Q = -7. - Raphie Frank, Dec 05 2015
From Peter Bala, Nov 16 2022: (Start)
The Gauss congruences hold: a(n*p^k) == a(n*p^(k-1)) (mod p^k) for all positive integers n and k and all primes p.
A268924(n) == a(3^n) (mod 3^n). (End)

A271223 Digits of one of the two 3-adic integers sqrt(-2).

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Apr 05 2016

Keywords

Comments

This is the scaled first difference sequence of A268924. See the formula.
The digits of the other 3-adic integer sqrt(-2), are given in A271224. See also A268924 for the two 3-adic numbers sqrt(-2), called there u and -u.
a(n) is the unique solution of the linear congruence 2*A268924(n)*a(n) + A271225(n) == 0 (mod 3), n>=1. Therefore only the values 0, 1, and 2 appear. See the Nagell reference given in A268922, eq. (6) on p. 86, adapted to this case. a(0) = 1 follows from the formula given below.
For details see the Wolfdieter Lang link under A268992.
The first k digits in the base 3 representation of Lucas(3^n) give the first k terms of the sequence. For example, the base 3 representation of Lucas(3^5) = 84722519070079276 begins 1 + 1*3 + 2*(3^2) + 0*(3^3) + 0*(3^4) + ... so the sequence begins [1, 1, 2, 0, 0, ...]. - Peter Bala, Nov 15 2022

Examples

			a(4) = 0 because 2*22*3 + 6 = 138 == 0 (mod 3).
a(4) = - 6*(2*22) (mod 3) = -0*(2*1) (mod 3) = 0.
A268924(5) =  22 = 1*3^0 + 1*3^1 + 2*3^2 + 0*3^3 + 0*3^4.
		

References

  • Trygve Nagell, Introduction to Number Theory, Chelsea Publishing Company, New York, 1964, pp. 86 and 77-78.

Crossrefs

Programs

  • Maple
    # uses properties of the numbers Lucas(3^n) = A006267(n)
    a := proc(n) option remember; if n = 1 then 1 else irem(a(n-1)^3 + 3*a(n-1), 3^n) end if; end proc:
    convert(a(70), base, 3); # Peter Bala, Nov 15 2022
  • PARI
    a(n) = truncate(sqrt(-2+O(3^(n+1))))\3^n; \\ Michel Marcus, Apr 09 2016

Formula

a(n) = (b(n+1) - b(n))/3^n, n >= 0, with b(n) = A268924(n), n >= 0.
a(n) = - A271225(n)*2*A268924(n) (mod 3), n >= 1. Solution of the linear congruence given above in a comment. See, e.g., Nagell, Theorem 38 pp. 77-78.
A268924(n+1) = sum(a(k)*3^k, k=0..n), n >= 0.

A271224 Digits of one of the two 3-adic integers sqrt(-2). Here the sequence with first digit 2.

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Apr 05 2016

Keywords

Comments

This is the scaled first difference sequence of A271222. See the formula.
The digits of the other 3-adic integer sqrt(-2), are given in A271223. See also a comment on A268924 for the two 3-adic numbers sqrt(-2), called there u and -u.
a(n) is the unique solution of the linear congruence 2*A271222(n)*a(n) + A271226(n) == 0 (mod 3), n>=1. Therefore only the values 0, 1, and 2 appear. See the Nagell reference given in A268922, eq. (6) on p. 86, adapted to this case.
a(0) = 2 follows from the formula given below.
For details see the Wolfdieter Lang link under A268992.
The first k digits in the base 3 representation of A002203(3^k) = A006266(k) give the first k terms of the sequence. - Peter Bala, Nov 26 2022

Examples

			a(4) = 2 because 2*59*2 + 43 = 279 == 0 (mod 3).
a(4) = - 43*(2*59) (mod 3) = -1*(2*(-1)) (mod 3) = 2.
A271222(5) = 221  = 2*3^0 + 1*3^1 + 0*3^2 + 2*3^3 + 2*3^4.
		

References

  • Trygve Nagell, Introduction to Number Theory, Chelsea Publishing Company, New York, 1964, pp. 86 and 77-78.

Crossrefs

Cf. A268924, A268992, A271222, A271226, A271223 (companion).

Programs

  • PARI
    a(n) = truncate(-sqrt(-2+O(3^(n+1))))\3^n; \\ Michel Marcus, Apr 09 2016

Formula

a(n) = (b(n+1) - b(n))/3^n, n >= 0, with b(n) = A271222(n), n >= 0.
a(n) = - A271226(n)*2*A271222(n) (mod 3), n >= 1. Solution of the linear congruence given above in a comment. See, e.g., Nagell, Theorem 38 pp. 77-78.
A271222(n+1) = sum(a(k)*3^k, k=0..n), n >= 0.

A271222 One of the two successive approximations up to 3^n for the 3-adic integer sqrt(-2). These are the numbers congruent to 2 mod 3 (except for the initial 0).

Original entry on oeis.org

0, 2, 5, 5, 59, 221, 221, 1679, 3866, 16988, 56354, 174452, 174452, 705893, 705893, 10271831, 24620738, 110714180, 239854343, 627274832, 2951797766, 2951797766, 2951797766, 65713916984, 159857095811, 442286632292
Offset: 0

Views

Author

Wolfdieter Lang, Apr 05 2016

Keywords

Comments

The other approximation for the 3-adic integer sqrt(-2) with numbers 1 (mod 3) is given in A268924.
For the digits of this 3-adic integer sqrt(-2), that is the scaled first differences, see A271224. This 3-adic number has the digits read from the right to the left ... 20020121022200011120021121201022212022012 = -u. For the digits of u see A271223.
For details see the W. Lang link ``Note on a Recurrence or Approximation Sequences of p-adic Square Roots'' given under A268922, also for the Nagell reference and Hensel lifting. Here p = 3, b = 2, x_2 = 2 and z_2 = 2.

Examples

			n=2: 5^2 + 2 = 27 == 0 (mod 3^2), and 5 is the only solution from {0, 1, ..., 8} which is congruent to 2 modulo 3.
n=3: the only solution of X^2 + 2 == 0 (mod 3^3) with X from {0, ..., 26} and X == 2(mod 3) is 5. The number 22 = A268924(3) also satisfies the first congruence but not the second one: 22  == 1 (mod 3).
n=4: the only solution of X^2 + 2 == 0 (mod 3^4) with X from {0, ..., 80} and X == 2 (mod 3) is 59. The number 22 = A268924(4) also satisfies the first congruence but not the second one: 59  == 1 (mod 3).
		

References

  • Trygve Nagell, Introduction to Number Theory, Chelsea Publishing Company, New York, 1964, p. 87.

Crossrefs

Programs

  • Maple
    with(padic):D2:=op(3,op([evalp(RootOf(x^2+2),3,20)][2])): 0,seq(sum('D2[k]*3^(k-1)','k'=1..n), n=1..20);
  • PARI
    a(n) = if (n, 3^n - truncate(sqrt(-2+O(3^(n)))), 0); \\ Michel Marcus, Apr 09 2016
    
  • Python
    def a271222(n):
          ary=[0]
          a, mod = 2, 3
          for i in range(n):
              b=a%mod
              ary.append(b)
              a=2*b**2 + b + 4
              mod*=3
          return ary
    print(a271222(100)) # Indranil Ghosh, Aug 04 2017, after Ruby
  • Ruby
    def A271222(n)
      ary = [0]
      a, mod = 2, 3
      n.times{
        b = a % mod
        ary << b
        a = 2 * b * b + b + 4
        mod *= 3
      }
      ary
    end
    p A271222(100) # Seiichi Manyama, Aug 03 2017
    

Formula

a(n)^2 + 2 == 0 (mod 3^n), and a(n) == 2 (mod 3). Representatives of the complete residue system {0, 1, ..., 3^n-1} are taken.
Recurrence for n >= 1: a(n) = modp(a(n-1) + 2*(a(n-1)^2 + 2), 3^n), n >= 2, with a(1) = 2. Here modp(a, m) is used to pick the representative of the residue class a modulo m from the smallest nonnegative complete residue system {0, 1, ... , m-1}.
a(n) = 3^n - A268924(n), n >= 1.
a(n) == A002203(3^n) (mod 3^n). - Peter Bala, Nov 10 2022

A318960 One of the two successive approximations up to 2^n for 2-adic integer sqrt(-7). This is the 1 (mod 4) case.

Original entry on oeis.org

1, 5, 5, 21, 53, 53, 181, 181, 181, 181, 181, 181, 181, 16565, 49333, 49333, 49333, 49333, 573621, 1622197, 1622197, 1622197, 10010805, 10010805, 10010805, 77119669, 211337397, 479772853, 479772853, 479772853, 2627256501, 6922223797, 15512158389, 15512158389
Offset: 2

Views

Author

Jianing Song, Sep 06 2018

Keywords

Comments

a(n) is the unique number k in [1, 2^n] and congruent to 1 (mod 4) such that k^2 + 7 is divisible by 2^(n+1).
The 2-adic integers are very different from p-adic ones where p is an odd prime. For example, provided that there is at least one solution, the number of solutions to x^n = a over p-adic integers is gcd(n, p-1) for odd primes p and gcd(n, 2) for p = 2. For odd primes p, x^2 = a is solvable iff a is a quadratic residue modulo p, while for p = 2 it's solvable iff a == 1 (mod 8). If gcd(n, p-1) > 1 and gcd(a, p) = 1, then the solutions to x^n = a differ starting at the rightmost digit for odd primes p, while for p = 2 they differ starting at the next-to-rightmost digit. As a result, the formulas and the program here are different from those in other entries related to p-adic integers.

Examples

			The unique number k in [1, 4] and congruent to 1 modulo 4 such that k^2 + 7 is divisible by 8 is 1, so a(2) = 1.
a(2)^2 + 7 = 8 which is not divisible by 16, so a(3) = a(2) + 2^2 = 5.
a(3)^2 + 7 = 32 which is divisible by 32, so a(4) = a(3) = 5.
a(4)^2 + 7 = 32 which is divisible by 64, so a(5) = a(4) + 2^4 = 21.
a(5)^2 + 7 = 448 which is divisible by 128, so a(6) = a(5) + 2^5 = 53.
...
		

Crossrefs

Cf. A318962.
Expansions of p-adic integers:
this sequence, A318961 (2-adic, sqrt(-7));
A268924, A271222 (3-adic, sqrt(-2));
A268922, A269590 (5-adic, sqrt(-4));
A048898, A048899 (5-adic, sqrt(-1));
A290567 (5-adic, 2^(1/3));
A290568 (5-adic, 3^(1/3));
A290800, A290802 (7-adic, sqrt(-6));
A290806, A290809 (7-adic, sqrt(-5));
A290803, A290804 (7-adic, sqrt(-3));
A210852, A212153 (7-adic, (1+sqrt(-3))/2);
A290557, A290559 (7-adic, sqrt(2));
A286840, A286841 (13-adic, sqrt(-1));
A286877, A286878 (17-adic, sqrt(-1)).
Also expansions of 10-adic integers:
A007185, A010690 (nontrivial roots to x^2-x);
A216092, A216093, A224473, A224474 (nontrivial roots to x^3-x).

Programs

  • PARI
    a(n) = truncate(-sqrt(-7+O(2^(n+1))))

Formula

a(2) = 1; for n >= 3, a(n) = a(n-1) if a(n-1)^2 + 7 is divisible by 2^(n+1), otherwise a(n-1) + 2^(n-1).
a(n) = 2^n - A318961(n).
a(n) = Sum_{i=0..n-1} A318962(i)*2^i.

Extensions

Offset corrected by Jianing Song, Aug 28 2019

A318961 One of the two successive approximations up to 2^n for 2-adic integer sqrt(-7). This is the 3 (mod 4) case.

Original entry on oeis.org

3, 3, 11, 11, 11, 75, 75, 331, 843, 1867, 3915, 8011, 16203, 16203, 16203, 81739, 212811, 474955, 474955, 474955, 2572107, 6766411, 6766411, 23543627, 57098059, 57098059, 57098059, 57098059, 593968971, 1667710795, 1667710795, 1667710795, 1667710795, 18847579979
Offset: 2

Views

Author

Jianing Song, Sep 06 2018

Keywords

Comments

a(n) is the unique number k in [1, 2^n] and congruent to 3 (mod 4) such that k^2 + 7 is divisible by 2^(n+1).
The 2-adic integers are very different from p-adic ones where p is an odd prime. For example, provided that there is at least one solution, the number of solutions to x^n = a over p-adic integers is gcd(n, p-1) for odd primes p and gcd(n, 2) for p = 2. For odd primes p, x^2 = a is solvable iff a is a quadratic residue modulo p, while for p = 2 it's solvable iff a == 1 (mod 8). If gcd(n, p-1) > 1 and gcd(a, p) = 1, then the solutions to x^n = a differ starting at the rightmost digit for odd primes p, while for p = 2 they differ starting at the next-to-rightmost digit. As a result, the formulas and the program here are different from those in other entries related to p-adic integers.

Examples

			The unique number k in [1, 4] and congruent to 3 modulo 4 such that k^2 + 7 is divisible by 8 is 3, so a(2) = 3.
a(2)^2 + 7 = 16 which is divisible by 16, so a(3) = a(2) = 3.
a(3)^2 + 7 = 16 which is not divisible by 32, so a(4) = a(3) + 2^3 = 11.
a(4)^2 + 7 = 128 which is divisible by 64, so a(5) = a(4) = 11.
a(5)^2 + 7 = 128 which is divisible by 128, so a(6) = a(5) = 11.
...
		

Crossrefs

Cf. A318963.
Expansions of p-adic integers:
A318960, this sequence (2-adic, sqrt(-7));
A268924, A271222 (3-adic, sqrt(-2));
A268922, A269590 (5-adic, sqrt(-4));
A048898, A048899 (5-adic, sqrt(-1));
A290567 (5-adic, 2^(1/3));
A290568 (5-adic, 3^(1/3));
A290800, A290802 (7-adic, sqrt(-6));
A290806, A290809 (7-adic, sqrt(-5));
A290803, A290804 (7-adic, sqrt(-3));
A210852, A212153 (7-adic, (1+sqrt(-3))/2);
A290557, A290559 (7-adic, sqrt(2));
A286840, A286841 (13-adic, sqrt(-1));
A286877, A286878 (17-adic, sqrt(-1)).
Also expansions of 10-adic integers:
A007185, A010690 (nontrivial roots to x^2-x);
A216092, A216093, A224473, A224474 (nontrivial roots to x^3-x).

Programs

  • PARI
    a(n) = if(n==2, 3, truncate(sqrt(-7+O(2^(n+1)))))

Formula

a(2) = 3; for n >= 3, a(n) = a(n-1) if a(n-1)^2 + 7 is divisible by 2^(n+1), otherwise a(n-1) + 2^(n-1).
a(n) = 2^n - A318960(n).
a(n) = Sum_{i=0..n-1} A318963(i)*2^i.

Extensions

Offset corrected by Jianing Song, Aug 28 2019

A309476 One of the two successive approximations up to 3^n for the 3-adic integer sqrt(-1/2).

Original entry on oeis.org

0, 1, 7, 16, 70, 232, 475, 1933, 1933, 8494, 28177, 87226, 87226, 1150108, 2744431, 12310369, 12310369, 55357090, 313637416, 313637416, 1475898883, 1475898883, 1475898883, 32856958492, 221143316146, 221143316146, 1915720535032, 4457586363361, 12083183848348, 34959976303309
Offset: 0

Views

Author

Seiichi Manyama, Aug 04 2019

Keywords

Examples

			a(1) = (   1)_3 = 1,
a(2) = (  21)_3 = 7,
a(3) = ( 121)_3 = 16,
a(4) = (2121)_3 = 70.
		

Crossrefs

Programs

  • Maple
    N:= 30: # for a(0) to a(N)
    with(padic):
    A:= rootp(x^2+1/2,3,N):
    if ratvaluep(A[1],1) = 1 then A:= A[1] else A:= A[2] fi:
    seq(ratvaluep(A,i),i=0..N); # Robert Israel, May 11 2020
  • PARI
    {a(n) = truncate(sqrt(-1/2+O(3^n)))}

A271226 a(n) = (A271222(n)^2 + 2)/3^n, n >= 0.

Original entry on oeis.org

2, 2, 3, 1, 43, 201, 67, 1289, 2278, 14662, 53782, 171798, 57266, 312537, 104179, 7353209, 14081926, 94917254, 148495259, 338541478, 2498895558, 832965186, 277655062, 45869694854, 90480235883, 230874654662
Offset: 0

Views

Author

Wolfdieter Lang, Apr 05 2016

Keywords

Comments

a(n) is an integer because b(n) = A271222(n) satisfies b(n)^2 + 2 == 0 (mod 3^n), n >= 0.
See A268924 for details, links and references.

Examples

			a(0) = (0^2 + 2)/1 = 2.
a(4) = (59^2 + 2)/3^4 = 43.
		

Crossrefs

Cf. A268924, A271222, A271224, A271225 (companion sequence).

Programs

  • PARI
    b(n) = if (n, 3^n - truncate(sqrt(-2+O(3^(n)))), 0);
    a(n) = (b(n)^2 + 2)/3^n; \\ Michel Marcus, Apr 09 2016

Formula

a(n) = (b(n)^2 + 2)/3^n, n >= 0, with b(n) = A271222(n).
Showing 1-10 of 10 results.