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.

A163873 a(n) = n - a(a(n-2)) with a(0) = a(1) = 0.

Original entry on oeis.org

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

Views

Author

Daniel Platt (d.platt(AT)web.de), Aug 08 2009

Keywords

Comments

A very near generalization of the Hofstadter G-sequence A005206 since it is part of the following family of sequences (which would give for k=1 the original G-sequence):
a(n) = n - a(a(n-k)) with a(0)=a(1)=...=a(k-1)=0 with k=1,2,3,... (here k=2).
Some things can be said about this family of sequences: Every a(n) occurs either exactly once or exactly k+1 times (except for the initial values which occur k times). A block of k+1 occurrences of the same number n is interrupted after the first one by the following k-1 elements: n+1, n+2, ..., n+k-1 (e.g., see from a(12) to a(15): 8, 9, 8, 8).
Since every natural number occurs in the sequence at least once and 0 <= a(n) <= n for all n the terms can be ordered in such a way that every n is connected to its a(n) in a tree structure so that:
.a(n)
..|..
..a..
This will give for the first 27 elements the following (ternary) tree:
....2._.....................
../...\..\_.................
./.....\.....\_.............
/.......\........\_.........
.........4...........5........
.........|...........|........
.........6...........7........
......../.\\......../.........
......./...\\____/___.......
.......|....\___/_...\......
.......|........./..\...\.....
.......|....__/....\...\....
.......8...9.........10...11..
....../\\./...........|...|...
...../..\X_______.....|...|...
..../.../\.....\....|...|...
...12..13...14...15..16...17..
../.\\./.....|....|../\\./....
./...\X___...|....|..|.\X__...
.|.../\_..\..|.../../../\..\..
.18.19.20.21.22.23.24.25.26.27
(X means two crossing paths)
This features a certain structure (similar to the G-sequence A005206 or other sequences of this family: A163875 and A163874). If the (below) following two constructs (C and D) are added on top of their ends (either marked with C or D) one will (if starting with one instance of D) receive the above tree (x marks a node, o marks spaces for nodes that are not part of the construct but will be filled by the other construct):
Diagram of D:
......x......
..../..\\....
.../....\.\..
..D...o..x.x.
.........|.|.
.........D.C.
(o will be filled by C)
Diagram of C:
.\...x.
\.\./..
.\./...
../.\..
./.\.\.
C...\.\
(This means construct C, on its way from a(n) to n, crosses exactly two other paths, e.g., from 17 to 25.)
Conjecture: This recursive structure exists for every sequence of the above mentioned family. The first node of D always has k+1 child nodes where the first one consists of a new copy of D, the second one consists of another node and then D. The remaining child nodes consist of another node and then C. Between the first and the second leaf there is always space for k-1 nodes of construct C. Construct C, on its way from a(n) to n, always crosses exactly k paths (the right ones from construct D).

Crossrefs

Same recurrence relation as A163801 and A135414.

Programs

Extensions

Definition corrected by Daniel Platt (d.platt(AT)web.de), Sep 14 2009

A163875 a(n)=n-a(a(n-4)) with a(0)=a(1)=a(2)=a(3)=0.

Original entry on oeis.org

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

Views

Author

Daniel Platt (d.platt(AT)web.de), Aug 08 2009

Keywords

Comments

A very near generalization of the Hofstadter G-sequence A005206 since it is part of the following family of sequences (which would give for k=1 the original G-sequence):
a(n)=n-a(a(n-k)) with a(0)=a(1)=...=a(k-1)=0 with k=1,2,3... (here k=4) - for general information about that family see A163873) Every a(n) occurs either exactly one or exactly five times (except from the initial values). A block of five occurrences of the same number n is after the first one interrupted by the following three elements: n+1,n+2 and n+3 (e.g. see from a(16) to a(23): 12, 13, 14, 15, 12, 12, 12, 12).
Since every natural number occurs in the sequence at least once and 0<=a(n)<=n for all n the elements can be ordered in such a way that every n is connected to its a(n) in a tree structure so that:
..a..
..|..
.a(n)
This will give for the first 55 elements the following (quintary) tree:
..............................4...................
...................../.../....|....\...\..........
.................../.../......|......\...\........
......................8.......9.......10..11......
..................../.........|........\....\.....
..................12.........13.........14...15...
................./...\\\\..../........../.../.....
................/...\_\\\_/........../.../......
.............../.../..\_\\\_______/.../.......
............./..../../._\_\\\________/........
.........../...../.././....\.\.\..\...............
.........16.....17.18.19..20.21.22.23.............
......../\\\\/__//__...\..\..\..\.............
......./..\\\/_/__/_..\...\..\..\..\............
....../....\\//__/_.\..\...\...\..\..\..........
...../......X__//_.\.\..\...\...\..\..\.........
..../....../../../..\.\.\..\...\....\..\..\.......
...24....25.26.27..28.29.30.31.32....33.34.35.....
../\\\\/__//__...|.|..|.|..\\\\/_/__/.....
./..\\\/_/__/..\..\.\..|.|..|\\\/_/__/.\....
|....\\//__/.\..\..\.\.|./..|.\X_/__/.\.\...
|.....X__//_.\.\..\..\.\\/...|./\|_|.\.\.\..
|..../../../..\.\.\..\..\.\/...|.|...|.|..\.\.\.\.
36.27.38.39..40.41.42.43..44..48.49.50.51.52.\54.\
...........................45................53.55
...........................46.....................
...........................47.....................
(X means two crossing paths)
Conjecture: This features a certain structure (similar to the G-sequence A005206 or other sequences of this family: A163874 and A163873). If the (below) following two constructs (C and D) are added on top of their ends (either marked with C or D) one will (if starting with one instance of D) receive the above tree (x marks a node, o marks spaces for nodes that are not part of the construct but will be filled by the other construct):
Diagram of D:
......x.............
..../..\\\\.........
.../....\\\.\.......
..|......\\.\.\.....
..|.......\.\.\.\...
..|........\.\.\.\..
..D..o.o.o..x.x.x.x.
............|.|.|.|.
............D.C.C.C.
(o will be filled by C)
Diagram of C:
\\\..x..
\\\\/...
.\\/\...
../\\\..
./.\\\\.
C...\\\\
(This means construct C crosses on its way from a(n) to n exactly four other paths, e.g. from 18 to 26)

Programs

Extensions

Terrible typos here and in A163874 and A163873! Corrected the sequence definition. Two further changes will be requested soon. A thousand apologies for the inconvenience Daniel Platt (d.platt(AT)web.de), Sep 14 2009

A130568 Generalized Beatty sequence 1+2*floor(n*phi), which contains infinitely many primes.

Original entry on oeis.org

1, 3, 7, 9, 13, 17, 19, 23, 25, 29, 33, 35, 39, 43, 45, 49, 51, 55, 59, 61, 65, 67, 71, 75, 77, 81, 85, 87, 91, 93, 97, 101, 103, 107, 111, 113, 117, 119, 123, 127, 129, 133, 135, 139, 143, 145, 149, 153, 155, 159, 161, 165, 169, 171, 175, 177, 181, 185, 187, 191, 195
Offset: 0

Views

Author

Jonathan Vos Post, Aug 09 2007

Keywords

Comments

The primes in this entirely odd sequence begin 3, 7, 13, 17, 19, 23, 29. By the theorems in Banks, there are an infinite number of primes in this sequence.
Conjecture: Sequence gives n of A163873 whose connection to a(n) crosses (in the tree of A163873) another path. Is this generalizable in any way for A163874, A163875? - Daniel Platt (d.platt(AT)web.de), Sep 14 2009

Examples

			a(0) = 1 + 2*floor(0*phi) = 1 + 2*0 = 1.
a(1) = 1 + 2*floor(1*phi) = 1 + 2*floor(1.6180) = 1 + 2*1 = 3.
a(2) = 1 + 2*floor(2*phi) = 1 + 2*floor(3.2360) = 1 + 2*3 = 7.
a(3) = 1 + 2*floor(3*phi) = 1 + 2*floor(4.8541) = 1 + 2*4 = 9.
a(4) = 1 + 2*floor(4*phi) = 1 + 2*floor(6.4721) = 1 + 2*6 = 13.
a(5) = 1 + 2*floor(5*phi) = 1 + 2*floor(8.0901) = 1 + 2*8 = 17.
a(6) = 1 + 2*floor(6*phi) = 1 + 2*floor(9.7082) = 1 + 2*9 = 19.
a(7) = 1 + 2*floor(7*phi) = 1 + 2*floor(11.3262) = 1 + 2*11 = 23.
a(8) = 1 + 2*floor(8*phi) = 1 + 2*floor(12.9442) = 1 + 2*12 = 25.
a(9) = 1 + 2*floor(9*phi) = 1 + 2*floor(14.5623) = 1 + 2*14 = 29.
a(10) = 1 + 2*floor(10*phi) = 1 + 2*floor(16.1803) = 1 + 2*16 = 33.
		

Crossrefs

Cf. A001622.

Programs

  • Magma
    [1+2*Floor(n*((1+Sqrt(5))/2)): n in [0..60]]; // Vincenzo Librandi, Sep 17 2015
    
  • Mathematica
    Table[1 + 2*Floor[n*(Sqrt[5] + 1)/2], {n, 0, 80}] (* Stefan Steinerberger, Aug 10 2007 *)
  • Python
    from math import isqrt
    def A130568(n): return (n+isqrt(5*n**2)&-2)|1 # Chai Wah Wu, May 22 2025

Formula

a(n) = 1+2*floor(n*phi), where phi = (1 + sqrt(5))/2.

Extensions

More terms from Stefan Steinerberger, Aug 10 2007

A165565 a(n) = n - a(a(a(n-3))) with a(0)=a(1)=a(2)=0.

Original entry on oeis.org

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

Views

Author

Daniel Platt (d.platt(AT)web.de), Sep 22 2009

Keywords

Comments

A generalization of the Hofstadter G-sequence A005206 since it is part of the following family of sequences (which would give for k=1, p=2 the original G-sequence):
a(n) = n - (a^p)(n-k) where (a^p) denotes p recurrences of a on the given argument (e.g., this sequence would be denoted as n-(a^3)(n-3)) with a(0)=a(1)=...=a(k-1)=0 with k=1,2,3,..., p=1,2,3,... (here k=p=3).
Shares nearly all properties with the a(n) = n - a(a(n-k)) family (quote from the page of the k=2-Sequence of this family, A163873, which applies to this family as well):
"Some things can be said about this family of sequences: Every a(n) occurs either exactly once or exactly k+1 times (except for the initial values which occur k times). A block of k+1 occurrences of the same number n is interrupted after the first one by the following k-1 terms: n+1, n+2, ..., n+k-1 (e.g., see from [for this sequence: a(15) to a(20): 12,13,14,12,12,12]).
Since every natural number occurs in each sequence of the family at least once and 0 <= a(n) <= n for all n [to be precise: From the (2*k)-th term on] the terms can be ordered in such a way that every n is connected to its a(n) in a tree structure so that:
.a(n)
..|..
..a.."
This will give a (k+1)-ary tree which (Conjecture:) features a certain structure (similar to the G-sequence A005206 or other sequences of the above mentioned family: A163873, A163875 and A163874). If the (below) following two constructs (C and D) are added on top of their ends (either marked with C or D) one will (if starting with one instance of D) receive the above tree (x marks a node, o marks spaces for nodes that are not part of the construct but will be filled by the other construct, constructs apply only to this sequence, comments for the whole family!):
Diagram of D:
......x..........
..../...\\\......
.../.....\\.\....
../.......\.\.\..
.D...o.o...x.x.x.
...........|.|.|.
...........x.x.x.
...........|.|.|.
...........D.C.C.
(o will be filled by C)
Diagram of C:
\\...x.
\\\./..
.\\/...
../\\..
./.\\\.
C...\\\
(This means construct C, on its way from a(n) to n, crosses exactly k other paths, e.g., from 14 to 17.)
The first node of D always has k+1 child nodes where the first one consists of a new copy of D, the second one consists of (p-1) other nodes and then D. The remaining child nodes consist of (p-1) other nodes and then C. Between the first and the second leaf there is always space for k-1 nodes of construct C. Construct C, on its way from a(n) to n, always crosses exactly k paths (the right ones from construct D).

Crossrefs

Mix from Hofstader H-Sequence A005374 and the Meta-Hofstadter G(-3)-Sequence A163874.

Programs

Showing 1-4 of 4 results.