login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Sum of distinct terms of A002674: a(0) = 0, a(2n) = A255411(A153880(a(n))), a(2n+1) = 1+A255411(A153880(a(n))).
8

%I #27 May 21 2021 10:05:57

%S 0,1,12,13,360,361,372,373,20160,20161,20172,20173,20520,20521,20532,

%T 20533,1814400,1814401,1814412,1814413,1814760,1814761,1814772,

%U 1814773,1834560,1834561,1834572,1834573,1834920,1834921,1834932,1834933,239500800,239500801,239500812,239500813,239501160,239501161,239501172,239501173,239520960,239520961

%N Sum of distinct terms of A002674: a(0) = 0, a(2n) = A255411(A153880(a(n))), a(2n+1) = 1+A255411(A153880(a(n))).

%C Fixed points of involution A225901.

%C This can be also viewed as a function that reinterprets base-2 representation of n in base-((2n)!/2) where the digits are multiplied with the successive terms of A002674, thus a(0) = 0.

%H Antti Karttunen, <a href="/A275959/b275959.txt">Table of n, a(n) for n = 0..8191</a>

%H <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>

%F a(0) = 0, a(2n) = A255411(A153880(a(n))), a(2n+1) = 1+A255411(A153880(a(n))).

%F a(n) = A276089(A276091(n)).

%o (Scheme, three versions. Some require _Antti Karttunen_'s IntSeq-library)

%o ;; This implements the given recurrence:

%o (definec (A275959 n) (cond ((zero? n) n) ((even? n) (A255411 (A153880 (A275959 (/ n 2))))) (else (+ 1 (A255411 (A153880 (A275959 (/ (- n 1) 2))))))))

%o (define (A275959 n) (A276089 (A276091 n)))

%o (define A275959 (FIXED-POINTS 0 0 A225901)) ;; Slow!

%o (Python)

%o from sympy import factorial as f

%o def a007623(n, p=2): return n if n<p else a007623(n//p, p+1)*10 + n%p

%o def a255411(n):

%o x=(str(a007623(n)) + '0')

%o y="".join(str(int(i) + 1) if int(i)>0 else '0' for i in x)[::-1]

%o return 0 if n==0 else sum([int(y[i])*f(i + 1) for i in range(len(y))])

%o def a153880(n):

%o x=(str(a007623(n)) + '0')[::-1]

%o return 0 if n==0 else sum([int(x[i])*f(i + 1) for i in range(len(x))])

%o def a(n): return 0 if n==0 else a255411(a153880(a(n//2))) if n%2==0 else 1 + a255411(a153880(a((n - 1)//2)))

%o print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 20 2017

%Y Cf. A002674, A059590, A153880, A255411, A276082, A276083, A276091.

%Y Fixed points of A225901.

%Y Subsequence of A275956 and of A276089.

%K nonn,base

%O 0,3

%A _Antti Karttunen_, Aug 16 2016