A101544 Smallest permutation of the natural numbers with a(3*k-2) + a(3*k-1) = a(3*k), k > 0.
1, 2, 3, 4, 5, 9, 6, 7, 13, 8, 10, 18, 11, 12, 23, 14, 15, 29, 16, 17, 33, 19, 20, 39, 21, 22, 43, 24, 25, 49, 26, 27, 53, 28, 30, 58, 31, 32, 63, 34, 35, 69, 36, 37, 73, 38, 40, 78, 41, 42, 83, 44, 45, 89, 46, 47, 93, 48, 50, 98, 51, 52, 103, 54, 55, 109, 56, 57, 113, 59, 60
Offset: 1
Keywords
Links
- Ivan Neretin, Table of n, a(n) for n = 1..10000
- Mark I. Krusemeyer, George T. Gilbert, Loren C. Larson, A Mathematical Orchard, Problems and Solutions, MAA, 2012, Problem 99, pp. 179-181.
- Index entries for sequences that are permutations of the natural numbers
Programs
-
Maple
N:= 100: # to get a(1) .. a(N) S:= {$1..N}: for n from 1 to N do if n mod 3 = 0 then A[n] := A[n-1]+A[n-2] else A[n]:= min(S) fi; S:= S minus {A[n]}; od: seq(A[i],i=1..N); # Robert Israel, Feb 07 2016
-
Mathematica
Fold[Append[#1, If[Divisible[#2, 3], #1[[-1]] + #1[[-2]], Min@Complement[Range[Max@#1 + 1], #1]]] &, {1}, Range[2, 71]] (* Ivan Neretin, Feb 05 2016 *)
-
PARI
A101544_upto(N, U=[], T=0)=vector(N, n, if(n%=3, while(if(U, U[1])==T+=1, U=U[^1]); n>1 || N=T; T, U=concat(U, N+=T); N)) apply( {A101544(n, k=(n-=1)\12, m=n\3%4, c=n%3)=(10*k+3*m-(m>1))<<(c>1)+c+(m<3 || c==1 || valuation(k+1,2)%2)}, [1..99]) \\ M. F. Hasler, Nov 26 2024
Formula
From Rémy Sigrist, Apr 05 2020: (Start)
- a(3*n-2) = A249031(2*n-1),
- a(3*n-1) = A249031(2*n),
- a(3*n) = A075326(n).
(End)
a(3*(4k + m) + c) = (10k + 3m - [m>1])*2^[c=3] + c - [m = 3 and c <> 2 and k+1 is in A036554], where 1 <= c <= 3, 0 <= m <= 3, and [.] is the Iverson bracket. - M. F. Hasler, Nov 26 2024
Comments