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 A386014 #74 Jul 24 2025 05:23:34 %S A386014 22,832,202,89302,2002,8993002,20002,899930002,200002,89999300002, %T A386014 2000002,8999993000002,20000002,899999930000002,200000002, %U A386014 89999999300000002,2000000002,8999999993000000002,20000000002,899999999930000000002,200000000002,89999999999300000000002,2000000000002 %N A386014 Distinct values occurring in first differences of A030655(n), listed in order of first appearance. %C A386014 A030655(t) = 2*t-1||2*t = (2*t-1)*10^k + 2*t, where || indicates digit concatenation and 2*t has digit length k. %C A386014 Difference A030655(t+1) - A030655(t) = 2*(10^k+1) when 2*t and 2*t+2 are both digit length k and this is the odd n case in the formulas below. %C A386014 2*t and 2*t+2 differ in length only at t = j(k) = 5*10^(k-1)-1 with 2*t+2 then having length k+1, and this is the even n case in the formulas below. %H A386014 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,110,-110,-1000,1000). %F A386014 a(n) = 2*(10^k + 1) for odd n, where k = (n+1)/2. %F A386014 a(n) = 9*100^k - 7*10^k + 2 for even n, where k = n/2. %e A386014 At t = j(3) = 499, difference A030655(t+1) - A030655(t) = 9991000 - 997998 = 8993002 which is term a(6). %p A386014 a := proc(n) %p A386014 if type(n, even) then %p A386014 k := n/2; %p A386014 return 9*100^k - 7*10^k + 2; %p A386014 else %p A386014 k := (n + 1)/2; %p A386014 return 2*(10^k + 1); %p A386014 end if; %p A386014 end proc: %p A386014 seq(a(n), n=1..12); %t A386014 a[n_] := Which[ %t A386014 EvenQ[n], Module[{k = n/2}, 9*100^k - 7*10^k + 2], %t A386014 OddQ[n], Module[{k = (n + 1)/2}, 2*(10^k + 1)] %t A386014 ]; %t A386014 Table[a[n], {n, 1, 12}] %o A386014 (Python) %o A386014 def a(n): %o A386014 k = (n + 1)//2 %o A386014 if n % 2 == 0: %o A386014 return 9 * 100**k - 7 * 10**k + 2 %o A386014 else: %o A386014 return 2 * (10**k + 1) %o A386014 (PARI) a(n) = if(n%2==1, 2*10^((n+1)/2)+2, 9*10^n - 7*10^(n/2) + 2) \\ _David A. Corneth_, Jul 17 2025 %Y A386014 Cf. A007376, A030655, A057147, A061084. %K A386014 nonn,easy,base %O A386014 1,1 %A A386014 _Carin Maria Sakin_, Jul 14 2025 %E A386014 More terms from _Michel Marcus_, Jul 16 2025 %E A386014 More terms from _David A. Corneth_, Jul 17 2025