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.

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

This page as a plain text file.
%I A163874 #11 Jan 06 2025 04:51:45
%S A163874 0,0,0,3,4,5,3,3,3,6,7,8,9,10,11,9,9,9,12,13,14,12,12,12,15,16,17,18,
%T A163874 19,20,18,18,18,21,22,23,24,25,26,24,24,24,27,28,29,27,27,27,30,31,32,
%U A163874 33,34,35,33,33,33,36,37,38,36,36,36,39,40,41,42,43,44,42,42,42,45,46,47
%N A163874 a(n) = n-a(a(n-3)) with a(0) = a(1) = a(2) = 0.
%C A163874 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):
%C A163874 a(n)=n-a(a(n-k)) with a(0)=a(1)=...=a(k-1)=0 with k=1,2,3... (here k=3) - for general information about that family see A163873) Every a(n) occurs either exactly one or exactly four times (except from the initial values). A block of four occurrences of the same number n is after the first one interrupted by the following two elements: n+1, n+2 (e.g. see from a(18) to a(23): 12, 13, 14, 12, 12, 12).
%C A163874 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:
%C A163874 ..a..
%C A163874 ..|..
%C A163874 .a(n)
%C A163874 This will give for the first 41 elements the following (quadrary) tree:
%C A163874 .......3..._..................................
%C A163874 ...../.|.\..\__...............................
%C A163874 ..../..|..\....\__............................
%C A163874 .../...|...\......\__.........................
%C A163874 ../....|....\........\........................
%C A163874 .......6.....7........8.......................
%C A163874 .......|.....|........|.......................
%C A163874 .......9.....10.......11......................
%C A163874 ....../.\\\../......../.......................
%C A163874 ...../...\\\/________/_________...............
%C A163874 ..../.....\/________/________..\..............
%C A163874 .../....../\_______/____.....\..\.............
%C A163874 ...|......|......./.....\.....\..\............
%C A163874 ..12......13....14.....15.....16..17..........
%C A163874 ...|\\\.../...../.......\......\...\..........
%C A163874 ...|.\\\_/_____/___......\......\...\.........
%C A163874 ...|..\\/_____/__..\......\......\...\........
%C A163874 ...|...X_____/_..\..\......\......\...\.......
%C A163874 ...|../...../..\..\..\......|......|...|......
%C A163874 ..18..19..20...21.22.23.....24.....25..26.....
%C A163874 ..|\\\./../.....\..\..\.....|\\\.../.../......
%C A163874 ..|.\\X__/____...\..\..\....|.\\\_/___/___....
%C A163874 ..|..X\_/___..\...\..\..\...|..\\/___/__..\...
%C A163874 ..|./.\/__..\..\...\..\..\..|...X___/_..\..\..
%C A163874 ../.|..\..\..\..\...|..|..|.|../.../..\..\..\.
%C A163874 .27.28.29.30.31.32.33.34.35.36.37.38..39.40.41
%C A163874 (X means two crossing paths)
%C A163874 Conjecture: This features a certain structure (similar to the G-sequence A005206 or other sequences of this family: A163875 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):
%C A163874 Diagram of D:
%C A163874 ......x...........
%C A163874 ..../..\\\........
%C A163874 .../....\\.\......
%C A163874 ..|......\\..\....
%C A163874 ..|.......\.\..\..
%C A163874 ..D..o.o...x.x..x.
%C A163874 ...........|.|..|.
%C A163874 ...........D.C..C.
%C A163874 (o will be filled by C)
%C A163874 Diagram of C:
%C A163874 \\...x.
%C A163874 \\\./..
%C A163874 .\\/...
%C A163874 ../\\..
%C A163874 ./.\\\.
%C A163874 C...\\\
%C A163874 (This means construct C crosses on its way from a(n) to n exactly three other paths, e.g. from 25 to 37)
%H A163874 Paolo Xausa, <a href="/A163874/b163874.txt">Table of n, a(n) for n = 0..10000</a>
%t A163874 A163874[n_] := A163874[n] = If[n < 3, 0, n - A163874[A163874[n-3]]];
%t A163874 Array[A163874, 100, 0] (* _Paolo Xausa_, Jan 05 2025 *)
%K A163874 nonn
%O A163874 0,4
%A A163874 Daniel Platt (d.platt(AT)web.de), Aug 08 2009, Sep 14 2009