cp's OEIS Frontend

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.

A101544 Smallest permutation of the natural numbers with a(3*k-2) + a(3*k-1) = a(3*k), k > 0.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Dec 06 2004

Keywords

Comments

Inverse: A101545; A101546(n) = a(a(n)).
From Bernard Schott, Jun 30 2019: (Start)
The terms can also be written simply following this array with 3 columns:
1st column 2nd column 3rd column
1 + 2 = 3
4 + 5 = 9
6 + 7 = 13
8 + 10 = 18
11 + 12 = 23
14 + 15 = 29
16 + 17 = 33
... ... ...
Question: in which column ends up the repdigit R_m(d) with m times the digit d?
Answer: R_m(d) will be in:
1) column 1 if d = 1, 4, 6, 8, or if d = 9 and m is even;
2) column 2 if d = 2, 5, 7;
3) column 3 if d = 3, or if d = 9 and m is odd.
Problem coming from Krusemeyer et al. (End)

Crossrefs

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