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 19 results. Next

A327724 Product of A003059 and A071797.

Original entry on oeis.org

1, 2, 4, 6, 3, 6, 9, 12, 15, 4, 8, 12, 16, 20, 24, 28, 5, 10, 15, 20, 25, 30, 35, 40, 45, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 9, 18, 27, 36, 45, 54
Offset: 1

Views

Author

Todor Szimeonov, Sep 23 2019

Keywords

Crossrefs

Programs

  • PARI
    a(n) = {(1+sqrtint(n-1))*(n-sqrtint(n-1)^2)} \\ Andrew Howroyd, Sep 23 2019

A053186 Square excess of n: difference between n and largest square <= n.

Original entry on oeis.org

0, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
Offset: 0

Views

Author

Henry Bottomley, Mar 01 2000

Keywords

Comments

From David W. Wilson, Jan 05 2009: (Start)
More generally we may consider sequences defined by:
a(n) = n^j - (largest k-th power <= n^j),
a(n) = n^j - (largest k-th power < n^j),
a(n) = (largest k-th power >= n^j) - n^j,
a(n) = (largest k-th power > n^j) - n^j,
for small values of j and k.
The present entry is the first of these with j = 1 and n = 2.
It might be interesting to add further examples to the OEIS. (End)
a(A000290(n)) = 0; a(A005563(n)) = 2*n. - Reinhard Zumkeller, May 20 2009
0 ^ a(n) = A010052(n). - Reinhard Zumkeller, Feb 12 2012
From Frank M Jackson, Sep 21 2017: (Start)
The square excess of n has a reference in the Bakhshali Manuscript of Indian mathematics elements of which are dated between AD 200 and 900. A section within describes how to estimate the approximate value of irrational square roots. It states that for n an integer with an irrational square root, let b^2 be the nearest perfect square < n and a (=a(n)) be the square excess of n, then
sqrt(n) = sqrt(b^2+a) ~ b + a/(2b) - (a/(2b))^2/(2(b+a/(2b))). (End)

Crossrefs

Cf. A002262, A048760. A071797(n) = 1 + a(n-1).
Cf. A002262. - Reinhard Zumkeller, May 20 2009

Programs

  • Haskell
    a053186 n = n - a048760 n
    a053186_list = f 0 0 (map fst $ iterate (\(y,z) -> (y+z,z+2)) (0,1))
       where f e x ys'@(y:ys) | x < y  = e : f (e + 1) (x + 1) ys'
                              | x == y = 0 : f 1 (x + 1) ys
    -- Reinhard Zumkeller, Apr 27 2012
  • Maple
    A053186 := proc(n) n-(floor(sqrt(n)))^2 ; end proc;
  • Mathematica
    f[n_] := n - (Floor@ Sqrt@ n)^2; Table[f@ n, {n, 0, 94}] (* Robert G. Wilson v, Jan 23 2009 *)
  • PARI
    A053186(n)= { if(n<0,0,n-sqrtint(n)^2) }
    

Formula

a(n) = n - A048760(n) = n - floor(sqrt(n))^2.
a(n) = f(n,1) with f(n,m) = if n < m then n else f(n-m,m+2). - Reinhard Zumkeller, May 20 2009

A027052 Triangular array T read by rows: T(n,0) = T(n,2n) = 1 for n >= 0, T(n,1)=0 for n >= 1, T(n,2)=1 for n >= 2 and for n >= 3, T(n,k) = T(n-1,k-3) + T(n-1, k-2) + T(n-1,k-1) for 3 <= k <= 2n-1. T(n,k)=0 for k < 0 or k > 2n.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 1, 1, 0, 1, 2, 3, 4, 1, 1, 0, 1, 2, 3, 6, 9, 8, 1, 1, 0, 1, 2, 3, 6, 11, 18, 23, 18, 1, 1, 0, 1, 2, 3, 6, 11, 20, 35, 52, 59, 42, 1, 1, 0, 1, 2, 3, 6, 11, 20, 37, 66, 107, 146, 153, 102, 1, 1, 0, 1, 2, 3, 6, 11, 20, 37, 68, 123, 210, 319, 406, 401, 256, 1
Offset: 0

Views

Author

Keywords

Comments

The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446. - Jeremy Gardiner, Mar 16 2003

Examples

			Triangle T(n,k) for 0 <= k <= 2n:
  1;
  1, 0, 1;
  1, 0, 1, 2, 1;
  1, 0, 1, 2, 3, 4, 1;
  1, 0, 1, 2, 3, 6, 9, 8, 1;
		

Crossrefs

Cf. A001590, a tribonacci sequence.
Cf. A160999 (row sums), A005408 (row lengths).
Diagonals T(n, n+c): A027053 (c=2), A027054 (c=3), A027055 (c=4).
Diagonals T(n, 2n-c): A027056 (c=1), A027058 (c=2), A027059 (c=3), A027060 (c=4), A027061(c=5), A027062 (c=6), A027063 (c=7), A027064 (c=8), A027065 (c=9), A027066 (c=10).
Other related sequences: A027057, A027071.
Other arrays of this type: A027023, A027082, A027113.

Programs

  • GAP
    T:= function(n,k)
        if k=0 or k=2 or k=2*n then return 1;
        elif k=1 then return 0;
        else return Sum([1..3], j-> T(n-1, k-j) );
        fi;
      end;
    Flat(List([0..10], n-> List([0..2*n], k-> T(n,k) ))); # G. C. Greubel, Nov 05 2019
  • Maple
    T:= proc(n, k) option remember;
          if k=0 or k=2 or k=2*n then 1
        elif k=1 then 0
        else add(T(n-1, k-j), j=1..3)
          fi
        end:
    seq(seq(T(n, k), k=0..2*n), n=0..10); # G. C. Greubel, Nov 05 2019
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0 || k==2 || k==2*n, 1, If[k==1, 0, Sum[T[n-1, k-j], {j, 3}]]]; Table[T[n, k], {n, 0, 12}, {k, 0, 2*n}]//Flatten (* G. C. Greubel, Nov 05 2019 *)
  • PARI
    {T(n, k) = if(k==0 || k==2 || k==2*n, 1, if(k==1, 0, sum(j=1,3, T(n-1, k-j)) ))};
    for(n=0, 10, for(k=0,2*n, print1(T(n,k), ", "))) \\ G. C. Greubel, Nov 05 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==0 or k==2 or k==2*n): return 1
        elif (k==1): return 0
        else: return sum(T(n-1, k-j) for j in (1..3))
    [[T(n, k) for k in (0..2*n)] for n in (0..10)] # G. C. Greubel, Nov 05 2019
    

Formula

A001590(k+1) = T(n,k) if 0 <= k <= n. - Michael Somos, Jun 01 2014

Extensions

Offset and keyword:tabl corrected by R. J. Mathar, Jun 01 2009

A194029 Natural fractal sequence of the Fibonacci sequence (1, 2, 3, 5, 8, ...).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
Offset: 1

Views

Author

Clark Kimberling, Aug 12 2011

Keywords

Comments

Suppose that c(1), c(2), c(3), ... is an increasing sequence of positive integers with c(1) = 1, and that the sequence c(k+1) - c(k) is strictly increasing. The natural fractal sequence f of c is defined by:
If c(k) <= n < c(k+1), then f(n) = 1 + n - c(k).
This defines the present sequence a(n) = f(n) for c = A000045.
The natural interspersion of c is here introduced as the array given by T(n,k) =(position of k-th n in f). Note that c = (row 1 of T).
As a different example from the one considered here (c = A000045), let c = A000217 = (1, 3, 6, 10, 15, ...), the triangular numbers, so that f = (1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, ...) = A002260, and a northwest corner of T = A194029 is:
1 3 6 10 15 ...
2 4 7 11 16 ...
5 8 12 17 23 ...
9 13 18 24 31 ...
...
Since every number in the set N of positive integers occurs exactly once in this (and every) interspersion, a listing of the terms of T by antidiagonals comprises a permutation, p, of N; letting q denote the inverse of p, we thus have for each c a fractal sequence, an interspersion T, and two permutations of N:
c f T / p q
It appears that this is also a triangle read by rows in which row n lists the first A000045(n) positive integers, n >= 1 (see example). - Omar E. Pol, May 28 2012
This is true, because the sequence c = A000045 has the property that c(k+1) - c(k) = c(k-1), so the number of integers {1, 2, 3, ...} to be filled in from index n = c(k) to n = c(k+1)-1 is equal to c(k-1); see also the first EXAMPLE. - M. F. Hasler, Apr 23 2022

Examples

			The sequence (1, 2, 3, 5, 8, 13, ...) is used to place '1's in positions numbered 1, 2, 3, 5, 8, 13, ...  Then gaps are filled in with consecutive counting numbers:
  1, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 5, 1, ...
From _Omar E. Pol_, May 28 2012: (Start)
Written as an irregular triangle the sequence begins:
  1;
  1;
  1, 2;
  1, 2, 3;
  1, 2, 3, 4, 5;
  1, 2, 3, 4, 5, 6, 7, 8;
  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13;
  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21; ...
The row lengths are A000045(n).
(End)
		

References

  • Clark Kimberling, "Fractal sequences and interspersions," Ars Combinatoria 45 (1997) 157-168.

Crossrefs

Cf. A000045 (Fibonacci numbers).
Cf. A066628, A194030, A194031 (natural interspersion of A000045 and inverse permutation).
Cf. A130853.

Programs

  • Maple
    T:= n-> $1..(<<0|1>, <1|1>>^n)[1, 2]:
    seq(T(n), n=1..10);  # Alois P. Heinz, Dec 11 2024
  • Mathematica
    z = 40;
    c[k_] := Fibonacci[k + 1];
    c = Table[c[k], {k, 1, z}]  (* A000045 *)
    f[n_] := If[MemberQ[c, n], 1, 1 + f[n - 1]]
    f = Table[f[n], {n, 1, 800}]  (* A194029 *)
    r[n_] := Flatten[Position[f, n]]
    t[n_, k_] := r[n][[k]]
    TableForm[Table[t[n, k], {n, 1, 8}, {k, 1, 7}]]
    p = Flatten[Table[t[k, n - k + 1], {n, 1, 13}, {k, 1, n}]]  (* A194030 *)
    q[n_] := Position[p, n]; Flatten[Table[q[n], {n, 1, 80}]]  (* A194031 *)
    Flatten[Range[Fibonacci[Range[66]]]] (* Birkas Gyorgy, Jun 30 2012 *)

Formula

a(n) = A066628(n)+1. - Alan Michael Gómez Calderón, Oct 30 2023

Extensions

Edited by M. F. Hasler, Apr 23 2022

A004737 Concatenation of sequences (1,2,...,n-1,n,n-1,...,1) for n >= 1.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 4, 3, 2, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5
Offset: 1

Views

Author

R. Muller

Keywords

Comments

The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446. - Jeremy Gardiner, Mar 16 2003
The ordinal transform of a sequence b_0, b_1, b_2, ... is the sequence a_0, a_1, a_2, ... where a_n is the number of times b_n has occurred in {b_0 ... b_n}.
From Artur Jasinski, Mar 07 2010: (Start)
This sequence is the even subset of A003983 for odd p=2,4,6,8,....
For the odd subset of A003983 see A004739. (End)
From Gary W. Adamson, Mar 30 2010: (Start)
Given the triangle rows: (1; 1,2,1; 1,2,3,2,1; ...) as polcoeff with offset 0:
q = (1 + 2x + x^2), r = (1 + 2x + 3x^2 + 2x^3 +x^4), etc.; then
(1 + 2x + 3x^2 + ...) = q(x) * q(x^2) * q(x^4) * q(x^8) * ...
..................... = r(x) * r(x^3) * r(x^9) * r(x^27) * ...
..................... = s(x) * s(x^4) * s(x^16)* s(x^64) * ...
... (End)
From L. Edson Jeffery, Jan 13 2012: (Start)
Let U_1(t)=1, U_2(t)=2*t, and U_r(t)=2*t*U_(r-1)(t)-U(r-2)(t), r>2, be Chebyshev polynomials of the second kind. For q>1 an integer, let N=2*q and x_k=cos((2*k-1)*Pi/N), and define the ordered column vectors V_k=[U_k(x_1), U_k(x_2), ..., U_k(x_q)]^T, k=1,...,q, where A^T denotes the transpose of matrix A. Let E_N=[V_1, V_2, ..., V_q] be the q X q matrix formed from the ordered components of the V_k. E_N contains the joint spectra of the Danzer basis (see [Jeffery]) associated with N. Let M_N=(1/q)*[E_N]^T*E_N. For the trivial case q=1, let M_2=[1]. CONJECTURE: E_N and M_N are always integral and symmetric, with M_N having diagonal entries {1,2,...} beginning at entries 1,j (j odd) in the first row and i,1 (i odd) in the first column and with zeros elsewhere. If N is allowed to increase without bound, and assuming the conjecture is true, then triangle A004737 emerges in its entirety from the successive antidiagonals containing those entries [M_N]_(i,j) such that i+j=2*v, for each v in {1,2,...,floor((q+1)/2)}. For example, for N=18 and q=9 (omitting the zeros for clarity),
M_18=[
(1 1 1 1 1);
( 2 2 2 2 );
(1 3 3 3 3);
( 2 4 4 4 );
(1 3 5 5 5);
( 2 4 6 6 );
(1 3 5 7 7);
( 2 4 6 8 );
(1 3 5 7 9)],
from which the first five rows of the sequence can be read off in succession. (End)
T(n,k) = min(n,k). The order of the list T(n,k) is by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). - Boris Putievskiy, Jan 13 2013
Expanded form of T(2,k) k=0,1,...,2m for ascending m-nomial triangles. - Bob Selcoe, Feb 07 2014
Terms in the first nine rows of the triangle can be duplicated by performing (111...)^2 with <= nine ones. By way of example, (11111)^2 = 123454321. - Gary W. Adamson, Mar 27 2015

Examples

			From _Boris Putievskiy_, Jan 13 2013: (Start)
The start of the sequence as a table:
  1 1 1 1 1 1 ...
  1 2 2 2 2 2 ...
  1 2 3 3 3 3 ...
  1 2 3 4 4 4 ...
  1 2 3 4 5 5 ...
  1 2 3 4 5 6 ...
  ...
The start of the sequence as an irregular triangle array read by rows:
  1;
  1,2,1;
  1,2,3,2,1;
  1,2,3,4,3,2,1;
  1,2,3,4,5,4,3,2,1;
  1,2,3,4,5,6,5,4,3,2,1;
  ...
Row number k contains 2*k-1 numbers: 1,2,...,k-1,k,k-1,...,1. (End)
The sequence of fractions A196199/A004737 = 0/1, -1/1, 0/2, 1/1, -2/1, -1/2, 0/3, 1/2, 2/1, -3/1, -2/2, -1/3, 0/4, 1/3, 2/2, 3/1, -4/4. -3/2, ... contains every rational number (infinitely often) [Laczkovich]. - _N. J. A. Sloane_, Oct 09 2013
		

References

  • Miklós Laczkovich, Conjecture and Proof, TypoTex, Budapest, 1998. See Chapter 10.
  • F. Smarandache, "Numerical Sequences", University of Craiova, 1975.

Crossrefs

Cf. A242357, A000290 (row sums).

Programs

  • Haskell
    import Data.List (inits)
    a004737 n = a004737_list !! (n-1)
    a004737_list = concatMap f $ tail $ inits [1..]
       where f xs = xs ++ tail (reverse xs)
    -- Reinhard Zumkeller, May 11 2014, Mar 26 2011
    
  • Mathematica
    Table[Min[n - #^2, (# + 1)^2 - n + 1] &@ Floor[Sqrt[n - 1]], {n, 105}] (* or *)
    Table[Floor@ # - Abs[n - Floor[#]^2 - Floor@ # - 1] + 1 &@ Sqrt[n - 1], {n, 105}] (* Michael De Vlieger, Oct 21 2016 *)
    Table[Join[Range[n],Range[n-1,1,-1]],{n,20}]//Flatten (* Harvey P. Dale, Dec 27 2019 *)
  • PARI
    a(n) = n--;my(m=sqrtint(n));m+1-abs(n-m^2-m) \\ David A. Corneth, Oct 18 2016

Formula

a(A002061(n)) = n; a(A000290(n)) = a(A002522(n)) = 1. - Reinhard Zumkeller, Mar 10 2006
a(n) = if n<3 then 1 else (if a(n-1)=1 then 1 + 0^(a(n-2)-1) else a(n-1) - 0^X + (a(n-1)-a(n-2))*(1 - 0^X)), where X = A003059(n-1)-a(n-1). - Reinhard Zumkeller, Mar 10 2006
Let b(n) = floor(sqrt(n-1)). Then a(n) = min(n - b(n)^2, (b(n)+1)^2 - n + 1). - Franklin T. Adams-Watters, Jun 09 2006
Ordinal transform of A004741. - Franklin T. Adams-Watters, Aug 28 2006
If the sequence is read as a triangular array, beginning [1]; [1,2,1]; [1,2,3,2,1]; ..., then the o.g.f. is (1+qx)/((1-x)(1-qx)(1-q^2x)) = 1 + x(1 + 2q + q^2) + x^2(1 + 2q + 3q^2 + 2q^3 +q^4) + .... The row polynomials for this triangle are (1 + q + ... + q^n)^2 =[n,2]A008967).%20-%20_Peter%20Bala">q + q[n-1,2]_q, where [n,2]_q are Gaussian polynomials (see A008967). - _Peter Bala, Sep 23 2007
a(n) = floor(sqrt(n-1)) - |n - floor(sqrt(n-1))^2 - floor(sqrt(n-1)) - 1| + 1. - Boris Putievskiy, Jan 13 2013
Read as a triangular array, then T(n,k) = n - |n-k-1|; T(n,0) = 1; T(n,n-1) = n. - Juan Pablo Herrera P., Oct 17 2016

Extensions

More terms from Patrick De Geest, Jun 15 1998

A006590 a(n) = Sum_{k=1..n} ceiling(n/k).

Original entry on oeis.org

1, 3, 6, 9, 13, 16, 21, 24, 29, 33, 38, 41, 48, 51, 56, 61, 67, 70, 77, 80, 87, 92, 97, 100, 109, 113, 118, 123, 130, 133, 142, 145, 152, 157, 162, 167, 177, 180, 185, 190, 199, 202, 211, 214, 221, 228, 233, 236, 247, 251, 258, 263, 270, 273, 282, 287, 296, 301
Offset: 1

Views

Author

Keywords

Comments

The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446. - Jeremy Gardiner, Mar 16 2003
Given the fact that ceiling(x) <= x+1, we can, using well known results for the harmonic series, easily derive that n*log(n) <= a(n) <= n*(1+log(n)) + n = n(log(n)+2). - Stefan Steinerberger, Apr 08 2006

References

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

Crossrefs

Programs

  • Haskell
    a006590 n = sum $ map f [1..n] where
       f x = y + 1 - 0 ^ r where (y, r) = divMod n x
    -- Reinhard Zumkeller, Feb 18 2013
    
  • Magma
    [&+[Ceiling(n/j): j in [1..n]] : n in [1..60]]; // G. C. Greubel, Nov 07 2019
    
  • Maple
    seq(add(ceil(n/j), j = 1..n), n = 1..60); # G. C. Greubel, Nov 07 2019
  • Mathematica
    Table[Sum[Ceiling[n/i], {i, 1, n}], {n, 1, 60}] (* Stefan Steinerberger, Apr 08 2006 *)
    nxt[{n_,a_}]:={n+1,a+DivisorSigma[0,n]+1}; Transpose[NestList[nxt,{1,1},60]][[2]] (* Harvey P. Dale, Aug 23 2013 *)
  • PARI
    first(n)=my(v=vector(n,i,i),s); for(i=1,n-1,v[i+1]+=s+=numdiv(i)); v \\ Charles R Greathouse IV, Feb 07 2017
    
  • PARI
    a(n) = n + sum(k=1, n-1, (n-1)\k); \\ Michel Marcus, Oct 10 2021
    
  • Python
    from math import isqrt
    def A006590(n): return (lambda m: n+2*sum((n-1)//k for k in range(1, m+1))-m*m)(isqrt(n-1)) # Chai Wah Wu, Oct 09 2021
  • Sage
    [sum(ceil(n/j) for j in (1..n)) for n in (1..60)] # G. C. Greubel, Nov 07 2019
    

Formula

a(n) = n+Sum_{k=1..n-1} tau(k). - Vladeta Jovovic, Oct 17 2002
a(n) = 1 + a(n-1) + tau(n-1), a(n) = A006218(n-1) + n. - T. D. Noe, Jan 05 2007
a(n) = a(n-1) + A000005(n) + 1 for n >= 2. a(n) = A161886(n) - A000005(n) + 1 = A161886(n-1) + 2 = A006218(n) + A049820(n) for n >= 1. - Jaroslav Krizek, Nov 14 2009

Extensions

More terms from Stefan Steinerberger, Apr 08 2006

A078358 Non-oblong numbers: Complement of A002378.

Original entry on oeis.org

1, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74
Offset: 1

Views

Author

Wolfdieter Lang, Nov 29 2002

Keywords

Comments

The (primitive) period length k(n)=A077427(n) of the (regular) continued fraction of (sqrt(4*a(n)+1)+1)/2 determines whether or not the Diophantine equation (2*x-y)^2 - (1+4*a(n))*y^2 = +4 or -4 is solvable and the approximants of this continued fraction give all solutions. See A077057.
The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446. - Jeremy Gardiner, Mar 16 2003
Infinite series 1/A078358(n) is divergent. Proof: Harmonic series 1/A000027(n) is divergent and can be distributed on two subseries 1/A002378(k+1) and 1/A078358(m). The infinite subseries 1/A002378(k+1) is convergent to 1, so Sum_{n>=1} 1/A078358(n) is divergent. - Artur Jasinski, Sep 28 2008

References

  • O. Perron, "Die Lehre von den Kettenbruechen, Bd.I", Teubner, 1954, 1957 (Sec. 30, Satz 3.35, p. 109 and table p. 108).

Crossrefs

a(n)=(A077425(n)-1)/4.
Cf. A049068 (subsequence), A144786.

Programs

  • Haskell
    a078358 n = a078358_list !! (n-1)
    a078358_list = filter ((== 0) . a005369) [0..]
    -- Reinhard Zumkeller, Jul 04 2014, May 08 2012
    
  • Mathematica
    Complement[Range[930], Table[n (n + 1), {n, 0, 30}]] (* and *) Table[Ceiling[Sqrt[n]] + n - 1, {n, 900}] (* Vladimir Joseph Stephan Orlovsky, Jul 20 2011 *)
  • PARI
    a(n)=sqrtint(n-1)+n \\ Charles R Greathouse IV, Jan 17 2013
    
  • Python
    from operator import sub
    from sympy import integer_nthroot
    def A078358(n): return n+sub(*integer_nthroot(n,2)) # Chai Wah Wu, Oct 01 2024

Formula

4*a(n)+1 is not a square number.
a(n) = ceiling(sqrt(n)) + n -1. - Leroy Quet, Jul 06 2007
A005369(a(n)) = 0. - Reinhard Zumkeller, Jul 05 2014

A071028 Triangle read by rows giving successive states of cellular automaton generated by "Rule 50".

Original entry on oeis.org

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

Views

Author

Hans Havermann, May 26 2002

Keywords

Comments

Row n has length 2n+1.
Rules #50, #58, #114, #122, #178, #179, #186, #242, #250 all give rise to this sequence.
The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446. - Jeremy Gardiner, Mar 16 2003

Examples

			Triangle begins:
1;
1, 0, 1;
1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
- _Philippe Deléham_, Mar 23 2014
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; Chapter 3.

Crossrefs

Cf. A071797.

Programs

  • Mathematica
    rows = 10; ca = CellularAutomaton[50, {{1}, 0}, rows-1]; Flatten[ Table[ca[[k, rows-k+1 ;; rows+k-1]], {k, 1, rows}]] (* Jean-François Alcover, May 24 2012 *)

Formula

a(n) = n - 1 + floor(sqrt(n)) - 2*Sum_{k=1..n-1} a(k) for n >= 1. - Benoit Cloitre, Jan 24 2013
a(n) = A071797(n) (mod 2). - Boris Putievskiy, Jul 24 2013
a(n) = (1+(-1)^(Sum_{k=1..floor(n/2)} floor((n-k)/k)))/2. - Wesley Ivan Hurt, Dec 25 2020

A080883 Distance of n to next square.

Original entry on oeis.org

1, 3, 2, 1, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 19, 18, 17, 16, 15, 14, 13
Offset: 0

Views

Author

Ralf Stephan, Mar 29 2003

Keywords

Comments

The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446, A080883. - Jeremy Gardiner, Dec 30 2006

Crossrefs

Cf. A075555.
Cf. A066635, A053188. - R. J. Mathar, Aug 08 2009

Programs

  • GAP
    List([0..90], n-> Int(1+RootInt(n))^2 -n); # G. C. Greubel, Nov 07 2019
  • Magma
    [Floor(1+Sqrt(n))^2 -n: n in [0..90]]; // G. C. Greubel, Nov 07 2019
    
  • Maple
    A080883 := proc(n) (floor(sqrt(n)+1))^2 -n ; end: seq( A080883(n),n=0..40) ; # R. J. Mathar, Aug 08 2009
  • Mathematica
    Table[Floor[1+Sqrt[n]]^2 -n, {n,0,90}] (* G. C. Greubel, Nov 07 2019 *)
  • PARI
    a(n) = (sqrtint(n)+1)^2-n; \\ Michel Marcus, May 22 2024
    
  • Sage
    [floor(1+sqrt(n))^2 -n for n in (0..90)] # G. C. Greubel, Nov 07 2019
    

Formula

a(n) = floor( sqrt(n)+1 )^2 - n.

A196199 Count up from -n to n for n = 0, 1, 2, ... .

Original entry on oeis.org

0, -1, 0, 1, -2, -1, 0, 1, 2, -3, -2, -1, 0, 1, 2, 3, -4, -3, -2, -1, 0, 1, 2, 3, 4, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8
Offset: 0

Views

Author

Keywords

Comments

This sequence contains every integer infinitely often, hence all integer sequences are subsequences.
This is a fractal sequence.
Indeed, if all terms (a(n),a(n+1)) such that a(n+1) does NOT equal a(n)+1 (<=> a(n+1) < a(n)) are deleted, the same sequence is recovered again. See A253580 for an "opposite" yet similar "fractal tree" construction. - M. F. Hasler, Jan 04 2015

Examples

			Table starts:
            0,
        -1, 0, 1,
    -2, -1, 0, 1, 2,
-3, -2, -1, 0, 1, 2, 3,
...
The sequence of fractions A196199/A004737 = 0/1, -1/1, 0/2, 1/1, -2/1, -1/2, 0/3, 1/2, 2/1, -3/1, -2/2, -1/3, 0/4, 1/3, 2/2, 3/1, -4/4. -3/2, ... contains every rational number (infinitely often) [Laczkovich]. - _N. J. A. Sloane_, Oct 09 2013
		

References

  • Miklós Laczkovich, Conjecture and Proof, TypoTex, Budapest, 1998. See Chapter 10.

Crossrefs

Cf. absolute values A053615, A002262, A002260, row lengths A005408, row sums A000004, A071797.

Programs

  • Haskell
    a196199 n k = a196199_row n !! k
    a196199_tabf = map a196199_row [0..]
    a196199_row n = [-n..n]
    b196199 = bFile' "A196199" (concat $ take 101 a196199_tabf) 0
    -- Reinhard Zumkeller, Sep 30 2011
    
  • Maple
    seq(seq(j-k-k^2, j=k^2 .. (k+1)^2-1), k = 0 .. 10); # Robert Israel, Jan 05 2015
    # Alternatively, as a table with rows -n<=k<=n (compare A257564):
    r := n -> (n-(n mod 2))/2: T := (n, k) -> r(n+k) - r(n-k):
    seq(print(seq(T(n, k), k=-n..n)), n=0..6); # Peter Luschny, May 28 2015
  • Mathematica
    Table[Range[-n, n], {n, 0, 9}] // Flatten
    (* or *)
    a[n_] := With[{t = Floor[Sqrt[n]]}, n - t (t + 1)];
    Table[a[n], {n, 0, 99}] (* Jean-François Alcover, Jul 13 2018, after Boris Putievskiy *)
  • PARI
    r=[];for(k=0,8,r=concat(r,vector(2*k+1,j,j-k-1)));r
    
  • Python
    from math import isqrt
    def A196199(n): return n-(t:=isqrt(n))*(t+1) # Chai Wah Wu, Aug 04 2022

Formula

a(n) = n - t*t - t - 1, where t = floor(sqrt(n-1)). - Boris Putievskiy, Jan 28 2013
G.f.: x/(x-1)^2 + 1/(x-1)*sum(k >= 1, 2*k*x^(k^2)). The series is related to Jacobi theta functions. - Robert Israel, Jan 05 2015
Showing 1-10 of 19 results. Next