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.
%I A265650 #53 Mar 05 2025 10:43:00 %S A265650 1,1,2,1,3,2,4,1,5,3,6,2,7,8,4,9,1,10,11,5,12,3,13,14,6,15,2,16,17,7, %T A265650 18,19,8,20,21,4,22,23,24,9,25,1,26,27,28,10,29,30,31,11,32,33,5,34, %U A265650 35,36,12,37,3,38,39,40,13,41,42,43,14,44,45,6,46,47,48,15,49,2,50,51,52,53,16,54,55,56,57,17,58,59,7,60,61,62,63,18,64,65,66 %N A265650 Removing the first occurrence of 1, 2, 3, ... reproduces the sequence itself. Each run of consecutive removed terms is separated from the next one by a term a(k) <= a(k-1) such that floor(sqrt(a(k))) equals the length of the run. %C A265650 A fractal sequence: If one deletes the first occurrence of 1, 2, 3, ... the original sequence is reproduced. %C A265650 Subsequent runs of consecutive terms which are these first occurrences are separated by a term whose square root yields the length of the preceding run (when rounded down). %C A265650 Motivated by Project Euler problem 535, see LINKS. %C A265650 The sequence contains marked numbers and non-marked numbers. A number is marked if it is the first occurrence of that number. %C A265650 The marked numbers are consecutive starting with a(1)=1. %C A265650 Immediately preceding each non-marked number in a(n), there are exactly floor(sqrt(a(n))) [= A000196(a(n))] adjacent marked numbers. %H A265650 Martin Møller Skarbiniks Pedersen, <a href="/A265650/b265650.txt">Table of n, a(n) for n = 1..1000</a> %H A265650 Project Euler, <a href="https://projecteuler.net/problem=535">Problem 535: Fractal Sequence</a> %H A265650 Clark Kimberling, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL10/Kimberling3/kimberling602.html">Interspersions and Fractal Sequences Associated with Fractions c^j/d^k</a>, Journal of Integer Sequences, Issue 5, Volume 10 (2007), Article 07.5.1 %e A265650 The runs of first occurrences of the positive integers are {1}, {2}, {3}, {4}, {5}, {6}, {7, 8}, {9}, {10, 11}, ... each separated from the next one by, respectively, 1, 1, 2, 1, 3, 2, 4, 1, 5, ... where 4 and 5 follow the groups {7, 8} and {10, 11} of length 2 = sqrt(4) = floor(sqrt(5)). - _M. F. Hasler_, Dec 13 2015 %o A265650 (C) %o A265650 #include <stdio.h> %o A265650 #include <math.h> %o A265650 #define SIZE 1000 %o A265650 unsigned int numbers[SIZE]; %o A265650 int main() { %o A265650 unsigned int pointer=0, next=1, circle_count=1, next_circle_number=2, sqrt_non_circle=1; %o A265650 numbers[0]=1; printf("1"); %o A265650 while (next<SIZE) { %o A265650 if (circle_count==sqrt_non_circle) { %o A265650 numbers[next]=numbers[pointer]; circle_count=0; pointer++; %o A265650 sqrt_non_circle=sqrt(numbers[pointer]); %o A265650 } else { %o A265650 circle_count++; numbers[next]=next_circle_number; %o A265650 next_circle_number++; %o A265650 } %o A265650 printf(",%u",numbers[next]); next++; %o A265650 } %o A265650 } %o A265650 (PARI) A265650(n, list=0, a=[1], cc=0, nc=1, p=0)={for(i=2, n, a=concat(a, if(0<=cc-=1, nc+=1, cc=sqrtint(a[!!p+p+=1]); a[p]))); list&&return(a); a[n]} \\ Set 2nd optional arg.to 1 to return the whole list. - _M. F. Hasler_, Dec 13 2015 %Y A265650 Cf. A000196, A003603, A035513. %K A265650 easy,nonn %O A265650 1,3 %A A265650 _Martin Møller Skarbiniks Pedersen_, Dec 11 2015 %E A265650 New name from _M. F. Hasler_, Dec 13 2015