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

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

A071797 Restart counting after each new odd integer (a fractal sequence).

Original entry on oeis.org

1, 1, 2, 3, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
Offset: 1

Views

Author

Antonio Esposito, Jun 06 2002

Keywords

Comments

The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446.
This is also a triangle read by rows in which row n lists the first 2*n-1 positive integers, n >= 1 (see example). - Omar E. Pol, May 29 2012
a(n) mod 2 = A071028(n). - Boris Putievskiy, Jul 24 2013
The triangle in the example is the triangle used by Kircheri in 1664. See the link "Mundus Subterraneus". - Charles Kusniec, Sep 11 2022

Examples

			a(1)=1; a(9)=5; a(10)=1;
From _Omar E. Pol_, May 29 2012: (Start)
Written as a triangle the sequence begins:
  1;
  1, 2, 3;
  1, 2, 3, 4, 5;
  1, 2, 3, 4, 5, 6, 7;
  1, 2, 3, 4, 5, 6, 7, 8, 9;
  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11;
  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;
Row n has length 2*n - 1 = A005408(n-1). (End)
		

Crossrefs

Cf. A074294.
Row sums give positive terms of A000384.

Programs

  • Haskell
    import Data.List (inits)
    a071797 n = a071797_list !! (n-1)
    a071797_list = f $ tail $ inits [1..] where
       f (xs:_:xss) = xs ++ f xss
    -- Reinhard Zumkeller, Apr 14 2014
  • Maple
    A071797 := proc(n)
        n-A048760(n-1) ;
    end proc: # R. J. Mathar, May 29 2016
  • Mathematica
    Array[Range[2# - 1]&, 10] // Flatten (* Jean-François Alcover, Jan 30 2018 *)
  • PARI
    a(n)=if(n<1,0,n-sqrtint(n-1)^2)
    

Formula

a(n) = 1 + A053186(n-1).
a(n) = n - 1 - ceiling(sqrt(n))*(ceiling(sqrt(n))-2); n > 0.
a(n) = n - floor(sqrt(n-1))^2, distance between n and the next smaller square. - Marc LeBrun, Jan 14 2004

A179753 Integers (2k)-1..0 followed by integers (2k)+1..0 and so on.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 03 2010

Keywords

Programs

  • Mathematica
    Flatten[Table[Range[2n-1,0,-1],{n,10}]] (* Harvey P. Dale, Oct 08 2012 *)
  • Python
    from math import isqrt
    def A179753(n): return (k:=(m:=isqrt(n))+(n>m*(m+1)))*(1+k)-n # Chai Wah Wu, Jun 06 2025

Formula

a(n) = (2*A000194(n)) - A074294(n).

A035505 Active part of Kimberling's expulsion array as a triangular array.

Original entry on oeis.org

4, 2, 6, 2, 7, 4, 8, 7, 9, 2, 10, 6, 6, 2, 11, 9, 12, 7, 13, 8, 13, 12, 8, 9, 14, 11, 15, 2, 16, 6, 2, 11, 16, 14, 6, 9, 17, 8, 18, 12, 19, 13, 18, 17, 12, 9, 19, 6, 13, 14, 20, 16, 21, 11, 22, 2, 16, 14, 21, 13, 11, 6, 22, 19, 2, 9, 23, 12, 24, 17, 25, 18, 23, 2, 12, 19, 24, 22, 17, 6
Offset: 1

Views

Author

Keywords

Comments

Active or shuffle part of Kimberling's expulsion array (A035486) is given by the elements K(i,j), where j < 2*i-3. [Enrique Pérez Herrero, Apr 14 2010]

Examples

			4 2; 6 2 7 4; 8 7 9 2 10 6; ...
		

References

  • R. K. Guy, Unsolved Problems Number Theory, Sect. E35.

Crossrefs

Programs

  • Mathematica
    A000194[n_] := Floor[(1 + Sqrt[4 n - 3])/2];
    A074294[n_] := n - 2*Binomial[Floor[1/2 + Sqrt[n]], 2];
    K[i_, j_] := i + j - 1 /; (j >= 2 i - 3);
    K[i_, j_] := K[i - 1, i - (j + 2)/2] /; (EvenQ[j] && (j < 2 i - 3));
    K[i_, j_] := K[i - 1, i + (j - 1)/2] /; (OddQ[j] && (j < 2 i - 3));
    A035505[n_] := K[A000194[n] + 2, A074294[n]]
    (* Enrique Pérez Herrero, Apr 14 2010 *)

Formula

From Enrique Pérez Herrero, Apr 14 2010: (Start)
a(n) = K(A000194(n)+2, A074294(n)), where
K(i,j) = i + j - 1; (j >= 2*i - 3)
K(i,j) = K(i-1, i-(j+2)/2) if j is even and j < 2*i - 3
K(i,j) = K(i-1, i+(j-1)/2); if j is odd and j < 2*i - 3.
(End)

Extensions

More terms from James Sellers, Dec 23 1999

A194011 Natural interspersion of A002061; a rectangular array, by antidiagonals.

Original entry on oeis.org

1, 3, 2, 7, 4, 5, 13, 8, 9, 6, 21, 14, 15, 10, 11, 31, 22, 23, 16, 17, 12, 43, 32, 33, 24, 25, 18, 19, 57, 44, 45, 34, 35, 26, 27, 20, 73, 58, 59, 46, 47, 36, 37, 28, 29, 91, 74, 75, 60, 61, 48, 49, 38, 39, 30, 111, 92, 93, 76, 77, 62, 63, 50, 51, 40, 41, 133, 112
Offset: 1

Views

Author

Clark Kimberling, Aug 15 2011

Keywords

Comments

See A194029 for definitions of natural fractal sequence and natural interspersion. Every positive integer occurs exactly once (and every pair of rows intersperse), so that as a sequence, A194011 is a permutation of the positive integers; its inverse is A194012.

Examples

			Northwest corner:
1...3...7...13...21...31
2...4...8...14...22...32
5...9...15..23...33...45
6...10..16..24...34...46
11..17..25..35...47...61
		

Crossrefs

Programs

  • Mathematica
    z = 40;
    c[k_] := k^2 - k + 1
    c = Table[c[k], {k, 1, z}]  (* A002061 *)
    f[n_] := If[MemberQ[c, n], 1, 1 + f[n - 1]]
    f = Table[f[n], {n, 1, 800}]  (* A074294 *)
    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, 16}, {k, 1, n}]]  (* A194011 *)
    q[n_] := Position[p, n]; Flatten[Table[q[n], {n, 1, 80}]]  (* A194012 *)

A194034 Natural interspersion of A028387, a rectangular array, by antidiagonals.

Original entry on oeis.org

1, 5, 2, 11, 6, 3, 19, 12, 7, 4, 29, 20, 13, 8, 9, 41, 30, 21, 14, 15, 10, 55, 42, 31, 22, 23, 16, 17, 71, 56, 43, 32, 33, 24, 25, 18, 89, 72, 57, 44, 45, 34, 35, 26, 27, 109, 90, 73, 58, 59, 46, 47, 36, 37, 28, 131, 110, 91, 74, 75, 60, 61, 48, 49, 38, 39, 155, 132
Offset: 1

Views

Author

Clark Kimberling, Aug 12 2011

Keywords

Comments

See A194029 for definitions of natural fractal sequence and natural interspersion. Every positive integer occurs exactly once (and every pair of rows intersperse), so that as a sequence, A194034 is a permutation of the positive integers; its inverse is A194035.

Examples

			Northwest corner:
1...5...11...19...29...41
2...6...12...20...30...42
3...7...13...21...31...43
4...8...14...22...32...44
9...15..23...33...45...59
		

Crossrefs

Programs

  • Mathematica
    z = 30;
    c[k_] := k^2 + k - 1;
    c = Table[c[k], {k, 1, z}]  (* A028387 *)
    f[n_] := If[MemberQ[c, n], 1, 1 + f[n - 1]]
    f = Table[f[n], {n, 1, 255}]  (* A074294 *)
    r[n_] := Flatten[Position[f, n]]
    t[n_, k_] := r[n][[k]]
    TableForm[Table[t[n, k], {n, 1, 7}, {k, 1, 7}]]
    p = Flatten[Table[t[k, n - k + 1], {n, 1, 13}, {k, 1, n}]]  (* A194034 *)
    q[n_] := Position[p, n]; Flatten[Table[q[n], {n, 1, 70}]]  (* A194035 *)

A253515 Count down from 2*k to 1, then from 2*(k+1) to 1 and so on.

Original entry on oeis.org

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

Views

Author

Mikael Aaltonen, Jan 03 2015

Keywords

Crossrefs

Cf. A074294.

Programs

  • Mathematica
    a253515[n_] := Block[{f}, f[x_] := 1 - x + Floor[Sqrt[x] + 3/2] * Floor[Sqrt[x] + 1/2]; Array[f, n]]; a253515[100] (* Michael De Vlieger, Jan 03 2015 *)
    Flatten[Table[Range[2n,1,-1],{n,10}]] (* Harvey P. Dale, Jan 15 2016 *)

Formula

a(n) = 1 - n + floor(sqrt(n)+3/2)*floor(sqrt(n)+1/2).
a(n) = A130829(n) - A074294(n).

A375797 Table T(n, k) read by upward antidiagonals. The sequences in each column k is a triangle read by rows (blocks), where each row is a permutation of the numbers of its constituents. Row number n in column k has length n*k = A003991(n,k); see Comments.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Aug 29 2024

Keywords

Comments

A208233 presents an algorithm for generating permutations, where each generated permutation is self-inverse.
The sequence in each column k possesses two properties: it is both a self-inverse permutation and an intra-block permutation of natural numbers.

Examples

			Table begins:
    k=    1   2   3   4   5   6
  -----------------------------------
  n= 1:   1,  1,  3,  1,  5,  1, ...
  n= 2:   2,  2,  2,  3,  2,  5, ...
  n= 3:   3,  3,  1,  2,  3,  3, ...
  n= 4:   6,  5,  4,  4,  4,  4, ...
  n= 5:   5,  4,  8,  5,  1,  2, ...
  n= 6:   4,  6,  6, 11,  6,  6, ...
  n= 7:   7,  7,  7,  7, 14,  7, ...
  n= 8:   9, 11,  5,  9,  8, 17, ...
  n= 9:   8,  9,  9,  8, 12,  9, ...
  n= 10: 10, 10, 18, 10, 10, 15, ...
  n= 11: 15,  8, 11,  6, 11, 11, ...
  n= 12: 12, 12, 16, 12,  9, 13, ...
  n= 13: 13, 13, 13, 13, 13, 12, ...
  n= 14: 14, 19, 14, 23,  7, 14, ...
  n= 15: 11, 15, 15, 15, 15, 10, ...
  n= 16: 16, 17, 12, 21, 30, 16, ...
  n= 17: 20, 16, 17, 17, 17,  8, ...
  n= 18: 18, 18, 10, 19, 28, 18, ...
     ... .
In column 3, the first 3 blocks have lengths 3,6 and 9. In column 6, the first 2 blocks have lengths 6 and 12. Each block is a permutation of the numbers of its constituents.
The first 6 antidiagonals are:
  1;
  2,1;
  3,2,3;
  6,3,2,1;
  5,5,1,3,5;
  4,4,4,2,2,1;
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=Module[{L,R,P,result},L=Ceiling[(Sqrt[8*n*k+k^2]-k)/(2*k)]; R=n-k*(L-1)*L/2; P=(((-1)^Max[R,k*L+1-R]+1)*R-((-1)^Max[R,k*L+1-R]-1)*(k*L+1-R))/2; result=P+k*(L-1)*L/2]
    Nmax=18; Table[T[n,k],{n,1,Nmax},{k,1,Nmax}]

Formula

T(n,k) = P(n,k) + k*(L(n,k)-1)*L(n,k)/2 = P(n,k) + A062707(L(n-1),k), where L(n,k) = ceiling((sqrt(8*n*k+k^2)-k)/(2*k)), R(n,k) = n-k*(L(n,k)-1)*L(n,k)/2, P(n,k) = (((-1)^max(R(n,k),k*L(n,k)+1-R(n,k))+1)*R(n,k)-((-1)^max(R(n,k),k*L(n,k)+1-R(n,k))-1)*(k*L(n,k)+1-R(n,k)))/2.
T(n,1) = A188568(n). T(1,k) = A093178(k). T(n,n) = A124625(n). L(n,1) = A002024(n). L(n,2) = A000194(n). L(n,3) = A111651(n). L(n,4) = A371355(n). R(n,1) = A002260(n). R(n,2) = A074294(n).
Showing 1-8 of 8 results.