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 A358793 #49 Jan 23 2025 10:22:59 %S A358793 1,3,7,5,10,8,14,16,11,20,22,13,26,28,17,32,34,19,38,40,23,44,46,25, %T A358793 50,52,29,56,58,31,62,64,35,68,70,37,74,76,41,80,82,43,86,88,47,92,94, %U A358793 49,98,100,53,104,106,55,110,112,59,116,118,61,122,124,65,128 %N A358793 Lexicographically earliest sequence of positive and unique integers such that 2*Sum_{k = 1..n} a(k) = Sum_{k = 1..n} a(a(k)) for n > 1 and a(1) = 1. %C A358793 There is a second version of this sequence possible if we change the definition to a(1) = 2 and a(n) > 1, then the sequence will start 2, 4, 5, 8, 10, 7, 14, ... . It will after this continue in the same way as our actual sequence does (and would also extend the valid range of the recurrence formulas). %C A358793 Start a(1) = 2 and value 1 allowed is A257794. %H A358793 Paolo Xausa, <a href="/A358793/b358793.txt">Table of n, a(n) for n = 1..10000</a> %H A358793 <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1,0,0,1,0,0,-1). %F A358793 G.f.: x*(1 + 3*x + 7*x^2 + 4*x^3 + 7*x^4 + x^5 + 8*x^6 + 3*x^7 - 4*x^8 + 2*x^9 - x^10 + x^11 - 3*x^12 + x^14)/(1 - x^3 - x^6 + x^9). %F A358793 a(n) = a(n-3) + a(n-6) - a(n-9) for n >= 16. %F A358793 a((3*(2*n-1) - (-1)^n)/4) = (3*(2*n-1) - (-1)^n)/2, for n > 3. %F A358793 a(6*n) = 6*n+1, for n > 1. %F A358793 a(6*n+3) = 6*n+5, for n > 0. %F A358793 a(n) = 30*n - 2*a(n-1) - 3*a(n-2) - 3*a(n-3) - 3*a(n-4) - 3*a(n-5) - 2*a(n-6) - a(n-7) - 96, for n > 13. %t A358793 LinearRecurrence[{0, 0, 1, 0, 0, 1, 0, 0, -1}, {1, 3, 7, 5, 10, 8, 14, 16, 11, 20, 22, 13, 26, 28, 17}, 100] (* _Paolo Xausa_, Jan 23 2025 *) %o A358793 (PARI) a(n) = {my(v = [1, 3, 7, 5, 10, 8]);if(n < 7, v[n], n*(1+min(1, n%3))+(n%3 == 0)+(n%6 == 3))} %Y A358793 Cf. A002516, A105753, A257794. %K A358793 nonn,easy %O A358793 1,2 %A A358793 _Thomas Scheuerle_, Dec 01 2022