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

A240808 a(0)=2, a(1)=1, a(2)=0; thereafter a(n) = a(n-1-a(n-1))+a(n-2-a(n-2)) unless a(n-1) <= n-1 or a(n-2) <= n-2 in which case the sequence terminates.

Original entry on oeis.org

2, 1, 0, 2, 1, 3, 2, 1, 3, 5, 4, 3, 5, 4, 6, 8, 4, 6, 8, 7, 9, 8, 7, 12, 11, 7, 12, 14, 10, 12, 14, 10, 12, 17, 13, 12, 20, 16, 12, 20, 19, 15, 20, 19, 18, 23, 19, 21, 26, 19, 21, 26, 19, 24, 29, 19, 27, 32, 19, 27, 32, 22, 30, 32, 22, 30, 32, 25, 33, 32, 28, 36, 32, 31, 39, 32, 31, 42, 35, 31, 45, 38, 31, 45, 38, 31, 48, 41, 31, 51, 44, 31, 51, 47, 34
Offset: 0

Views

Author

N. J. A. Sloane, Apr 15 2014

Keywords

Comments

a(A241218(n)) = n and a(m) <> n for m < A241218(n). - Reinhard Zumkeller, Apr 17 2014

References

  • Higham, Jeff and Tanny, Stephen, A tamely chaotic meta-Fibonacci sequence. Twenty-third Manitoba Conference on Numerical Mathematics and Computing (Winnipeg, MB, 1993). Congr. Numer. 99 (1994), 67-94. [Contains a detailed analysis of this sequence]

Crossrefs

A006949 and A240807 have the same recurrence but different initial conditions.
Trisections: A244780..A244782.

Programs

  • Haskell
    a240808 n = a240808_list !! n
    a240808_list = 2 : 1 : 0 : zipWith (+) xs (tail xs)
       where xs = map a240808 $ zipWith (-) [1..] $ tail a240808_list
    -- Reinhard Zumkeller, Apr 17 2014
  • Maple
    a:=proc(n) option remember; global k;
    if n = 0 then 2
    elif n = 1 then 1
    elif n = 2 then 0
    else
    if (a(n-1) <= n-1) and (a(n-2) <= n-2) then
    a(n-1-a(n-1))+a(n-2-a(n-2));
    else lprint("died with n =",n); return (-1);
    fi;
    fi; end;
    [seq(a(n),n=0..100)];
  • Mathematica
    a[n_] := a[n] = Switch[n, 0, 2, 1, 1, 2, 0, _,
       If[a[n - 1] <= n - 1 && a[n - 2] <= n - 2,
       a[n - 1 - a[n - 1]] + a[n - 2 - a[n - 2]],
       Print["died with n =", n]; Return[-1]]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Oct 02 2024 *)

A244819 Positive numbers primitively represented by the binary quadratic form (1, 0, 3).

Original entry on oeis.org

1, 3, 4, 7, 12, 13, 19, 21, 28, 31, 37, 39, 43, 49, 52, 57, 61, 67, 73, 76, 79, 84, 91, 93, 97, 103, 109, 111, 124, 127, 129, 133, 139, 147, 148, 151, 156, 157, 163, 169, 172, 181, 183, 193, 196, 199, 201, 211, 217, 219, 223, 228, 229, 237, 241, 244, 247, 259
Offset: 1

Views

Author

Peter Luschny, Jul 06 2014

Keywords

Comments

Discriminant = -12.
x^2 + 3*y^2 represents positive k properly (gcd(x, y) = 1), with nonnegative x, and the following multiplicities m(k): m(1) = 1, m(3) = 1, m(4) = 2, and if k = 3^a*4^b*Product_{j=1..P1} p1(j)^e1(j), with p1(j) primes 1 (mod 6) (A002476), e1(j) nonnegative integer numbers, and a and b from {0, 1}, then m(k) = 2^(P1+b). Shown by the lifting theorem (e.g., Apostol) for prime powers. Note that for prime 2 there is one solution of j^2 + 3 == 0 (mod 2) this corresponds the imprimitive reduced form (2, 2, 2), not to the one reduced primitive form (1, 0, 3) for discriminant -12 (A000003(3) = 1). - Wolfdieter Lang, Mar 02 2021

Examples

			Proper solution to x^2 + 3*y^2 = a(n), with x nonnegative: a(12 = 3*4) with (x, y) = (3, pm 1), pm = +1 or -1, multiplicity m(12) = 2, (a, b, P1) = (1, 1, 0); a(21 = 3*7) with (3, pm 2), m(21) = 2, (a, b, P1) = (1, 0, 1); a(49 = 7^2) with (1, pm 4), m(49) = 2 (a, b, P1) = (0, 0, 1)). - _Wolfdieter Lang_, Mar 02 2021
		

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976 (1986), Theorem 5.30, pp. 121-122.

Crossrefs

Programs

  • Maple
    # Function PriRepBQF in A244779.
    A244819 list := n -> PriRepBQF(1, 0, 3, n); A244819_list(259);
  • Mathematica
    Reap[For[n = 1, n < 1000, n++, r = Reduce[x^2 + 3 y^2 == n, {x, y}, Integers]; If[r =!= False, If[AnyTrue[{x, y} /. {ToRules[r /. C[1] -> 0]}, CoprimeQ @@ # &], Sow[n]]]]][[2, 1]] (* Jean-François Alcover, Oct 31 2016 *)

A244779 Positive numbers primitively represented by the binary quadratic form (1, 1, 2).

Original entry on oeis.org

1, 2, 4, 7, 8, 11, 14, 16, 22, 23, 28, 29, 32, 37, 43, 44, 46, 53, 56, 58, 64, 67, 71, 74, 77, 79, 86, 88, 92, 106, 107, 109, 112, 113, 116, 121, 127, 128, 134, 137, 142, 148, 149, 151, 154, 158, 161, 163, 172, 176, 179, 184, 191, 193, 197, 203, 211, 212, 214
Offset: 1

Views

Author

Peter Luschny, Jul 06 2014

Keywords

Comments

Discriminant = -7.

Crossrefs

Programs

  • Maple
    PriRepBQF := proc(a, b, c, n) local L,q,R,r,k;
    q := a*x^2 + b*x*y + c*y^2; L := NULL;
    for k from 1 to n do
       R := [isolve(q = k)];
       if R = [] then next fi;
       for r in R do
          igcd(op(2,r[1]), op(2,r[2]));
          if 1 = % then L := L,k; break fi od
    od; L end:
    A244779_list := n -> PriRepBQF(1, 1, 2, n); A244779_list(214);
    # Alternate program
    A244779_set:= proc(N) local A, B, y,x;
       A:= {};
       for y from 0 to floor(sqrt(4*N/7)) do
         for x from ceil(-y/2) to floor(-y/2 + sqrt(N - 7/4*y^2)) do
           if igcd(x,y) = 1 then
             A:= A union {x^2 + x*y + 2*y^2}
           fi
         od
        od;
    A
    end proc:
    A244779_set(1000); # Robert Israel, Jul 06 2014
  • Mathematica
    Reap[For[n = 1, n < 1000, n++, r = Reduce[x^2 + x y + 2 y^2 == n, {x, y}, Integers]; If[r =!= False, If[AnyTrue[{x, y} /. {ToRules[r /. C[1] -> 0]}, CoprimeQ @@ # &], Sow[n]]]]][[2, 1]] (* Jean-François Alcover, Oct 31 2016 *)

A244481 First trisection of A240808.

Original entry on oeis.org

1, 1, 1, 4, 4, 4, 7, 7, 7, 10, 10, 13, 16, 19, 19, 19, 19, 19, 19, 19, 22, 22, 25, 28, 31, 31, 31, 31, 31, 31, 31, 34, 37, 40, 40, 43, 46, 46, 49, 49, 52, 55, 58, 61, 64, 64, 67, 70, 73, 73, 76, 79, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 85, 88, 91
Offset: 0

Views

Author

N. J. A. Sloane, Jul 03 2014

Keywords

References

  • Higham, Jeff and Tanny, Stephen, A tamely chaotic meta-Fibonacci sequence. Twenty-third Manitoba Conference on Numerical Mathematics and Computing (Winnipeg, MB, 1993). Congr. Numer. 99 (1994), 67-94.

Crossrefs

A244482 Second trisection of A240808.

Original entry on oeis.org

0, 3, 3, 3, 6, 6, 9, 12, 12, 12, 12, 12, 12, 15, 18, 21, 21, 24, 27, 27, 30, 30, 33, 36, 39, 42, 45, 45, 48, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 54, 54, 57, 60, 63, 66, 69, 69, 72, 75, 78, 81, 84, 84, 87, 90, 90, 93, 93, 96, 99, 102, 105, 108, 108, 111, 114, 114
Offset: 0

Views

Author

N. J. A. Sloane, Jul 03 2014

Keywords

References

  • Higham, Jeff and Tanny, Stephen, A tamely chaotic meta-Fibonacci sequence. Twenty-third Manitoba Conference on Numerical Mathematics and Computing (Winnipeg, MB, 1993). Congr. Numer. 99 (1994), 67-94.

Crossrefs

Showing 1-5 of 5 results.