A353652 Unique monotonic sequence of positive integers satisfying a(a(n)) = k*(n-1) + 3, where k = 5.
2, 3, 8, 9, 10, 11, 12, 13, 18, 23, 28, 33, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 68, 73, 78, 83, 88, 93, 98, 103, 108, 113, 118, 123, 128, 133, 138, 143, 148, 153, 158, 163, 168, 173, 178, 183, 188
Offset: 1
Examples
a(7) = 12 because (5^1 + 1)/2 <= 7 < (3*5^1 + 1)/2, hence a(7) = 7 + 5^1 = 12; a(11) = 28 because (3*5^1 + 1)/2 <= 11 < (5*5^1 + 1)/2, hence a(11) = 5*(11 - 5^1) - 2 = 28.
Links
Crossrefs
Programs
-
Mathematica
a[n_] := Module[{n2 = 2n, p}, p = 5^Floor@Log[5, n2]; If[n2 < 3p, n+p, 5(n-p)-2]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Sep 22 2023, after Kevin Ryde *)
-
PARI
a(n) = my(n2=n<<1, p=5^logint(n2, 5)); if(n2 < 3*p, n+p, 5*(n-p)-2); \\ Kevin Ryde, Apr 18 2022 (C++) /* program used to generate the b-file */ #include
using namespace std; int main(){ int cnt1=1, flag=0, cnt2=1, a=2; for(int n=1; n<=10000; n++) { cout<
Formula
For n in the range (5^i + 1)/2 <= n < (3*5^i + 1)/2, for i >= 0:
a(n) = n + 5^i.
a(n+1) = 1 + a(n).
Otherwise, for n in the range (3*5^i + 1)/2 < n <= (5*5^i + 1)/2, for i >= 0:
a(n) = 5*(n - 5^i) - 2.
a(n+1) = 5 + a(n).
Comments