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.

Showing 1-6 of 6 results.

A030103 Base 4 reversal of n (written in base 10).

Original entry on oeis.org

0, 1, 2, 3, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15, 1, 17, 33, 49, 5, 21, 37, 53, 9, 25, 41, 57, 13, 29, 45, 61, 2, 18, 34, 50, 6, 22, 38, 54, 10, 26, 42, 58, 14, 30, 46, 62, 3, 19, 35, 51, 7, 23, 39, 55, 11, 27, 43, 59, 15, 31, 47, 63, 1, 65, 129, 193, 17, 81, 145, 209, 33, 97, 161
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr)
    a030103 n = foldl (\v d -> 4*v + d) 0 $ unfoldr dig n where
        dig x = if x == 0 then Nothing else Just $ swap $ divMod x 4
    -- Reinhard Zumkeller, Oct 10 2011
    
  • Mathematica
    IntegerReverse[Range[0, 100], 4] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n,b=4)=subst(Polrev(base(n,b)),x,b) /* where */
    base(n,b)={my(a=[n%b]);while(0M. F. Hasler, Nov 04 2011
    (MIT/GNU Scheme)
    (define (A030103 n) (if (zero? n) n (let ((uplim (+ (A000523 n) (- 1 (modulo (A000523 n) 2))))) (add (lambda (i) (* (bit_i n (+ i (expt -1 i))) (expt 2 (- uplim i)))) 0 uplim))))
    (define (bit_i n i) (modulo (floor->exact (/ n (expt 2 i))) 2))
    ;; The functional add implements sum_{i=lowlim..uplim} intfun(i):
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
    ;; Antti Karttunen, Oct 30 2013

A035522 Reverse and add (in binary) - written in base 10.

Original entry on oeis.org

1, 2, 3, 6, 9, 18, 27, 54, 81, 150, 255, 510, 765, 1530, 2295, 6120, 6885, 12240, 13005, 24480, 25245, 48960, 49725, 97920, 98685, 196224, 197757, 392448, 393981, 785664, 788733, 1571328, 1574397, 3144192, 3150333, 6288384
Offset: 0

Views

Author

N. J. A. Sloane, E. M. Rains

Keywords

Examples

			6 = 110, 110 + 011 = 1001 = 9, so 6 is followed by 9.
		

Crossrefs

Programs

  • Haskell
    a035522 n = a035522_list !! n
    a035522_list = iterate a055944 1
    -- Reinhard Zumkeller, Oct 21 2011
  • Mathematica
    nxt[n_]:=Module[{idn2=IntegerDigits[n,2]},FromDigits[idn2+ Reverse[ idn2],2]]; NestList[nxt,1,40] (* Harvey P. Dale, Oct 02 2011 *)

Formula

a(n+1) = A055944(a(n)), a(0) = 1. [Reinhard Zumkeller, Nov 14 2011]

A055948 n + reversal of base 4 digits of n (written in base 10).

Original entry on oeis.org

0, 2, 4, 6, 5, 10, 15, 20, 10, 15, 20, 25, 15, 20, 25, 30, 17, 34, 51, 68, 25, 42, 59, 76, 33, 50, 67, 84, 41, 58, 75, 92, 34, 51, 68, 85, 42, 59, 76, 93, 50, 67, 84, 101, 58, 75, 92, 109, 51, 68, 85, 102, 59, 76, 93, 110, 67, 84, 101, 118, 75, 92, 109, 126, 65, 130, 195
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

If n has an even number of digits in base 4 then a(n) is a multiple of 5.

Crossrefs

Cf. A035524 (iterated).

Programs

  • Haskell
    a055948 n = n + a030103 n
    -- Reinhard Zumkeller, Oct 10 2011
  • Mathematica
    Table[n+FromDigits[Reverse[IntegerDigits[n,4]],4],{n,0,70}] (* Harvey P. Dale, Nov 24 2021 *)

Formula

a(n) = n + A030103(n).

A091675 Positive integers n such that the trajectory of n under the Reverse and Add! operation carried out in base 4 (presumably) does not join the trajectory of any m < n.

Original entry on oeis.org

1, 3, 21, 22, 26, 29, 31, 55, 256, 258, 262, 266, 269, 271, 282, 286, 287, 302, 312, 413, 479, 511, 519, 551, 555, 719, 795, 799, 1026, 1029, 1034, 1037, 1066, 1549, 1790, 2863, 3087, 3119, 4096, 4098, 4102, 4104, 4106, 4108, 4109, 4113, 4114, 4116, 4117
Offset: 1

Views

Author

Klaus Brockhaus, Jan 28 2004

Keywords

Comments

The conjecture that the base-4 trajectories of the terms do not join is based on the observation that if the trajectories of two integers below 4120 join, this happens after at most 28 steps, while for any two terms listed above the trajectories do not join within 1000 steps. For pairs from 1, 3, 21, 22, 26, 29, 31, 55 this has even been checked for 5000 steps.
Base-4 analog of A070788.

Examples

			The trajectory of 2 is part of the trajectory of 1 (cf. A035524); the trajectory of 3 does not join the trajectory of 1 within 10000 steps; the trajectory of 21 does not join the trajectory of 1 or of 3 within 10000 steps.
		

Crossrefs

Programs

  • Mathematica
    limit = 10^3; utraj = {};
    Select[Range[4120], (x = NestList[ # + IntegerReverse[#, 4] &, #, limit]; If[Intersection[x, utraj] == {}, utraj = Union[utraj, x]; True, utraj = Union[utraj, x]]) &] (* Robert Price, Oct 20 2019 *)

A091678 In base 4, numbers n of the form k + reverse(k) for at least one k.

Original entry on oeis.org

0, 2, 4, 5, 6, 10, 15, 17, 20, 25, 30, 33, 34, 41, 42, 50, 51, 58, 59, 65, 67, 68, 75, 76, 84, 85, 92, 93, 101, 102, 105, 109, 110, 118, 125, 126, 130, 145, 150, 165, 170, 185, 190, 195, 210, 215, 230, 235, 250, 255, 257, 260, 275, 280, 289, 295, 300, 315, 320, 321
Offset: 0

Views

Author

Klaus Brockhaus, Jan 28 2004

Keywords

Comments

Base-4 analog of A067030. Complement of A091679.

Examples

			25 is a term since 25 (decimal) = 121 = 110 + 011 = 20 (decimal) + 5 (decimal).
		

Crossrefs

A091680 Smallest number whose base-4 Reverse and Add! trajectory (presumably) contains exactly n base-4 palindromes, or -1 if there is no such number.

Original entry on oeis.org

290, 78, 18, 6, 3, 36, 21, 19, 7, 8, 4, 2, 1, -1, -1, -1, -1, -1, -1, -1, -1
Offset: 0

Views

Author

Klaus Brockhaus, Jan 28 2004

Keywords

Comments

Conjecture 1: For each k > 0 the trajectory of k eventually leads to a term in the trajectory of some j which belongs to A075421, i.e., whose trajectory (presumably) never leads to a palindrome. Conjecture 2: There is no k > 0 such that the trajectory of k contains more than twelve palindromes, i.e., a(n) = -1 for n > 12.
Base-4 analog of A077594.

Examples

			a(4) = 3 since the trajectory of 3 contains the four palindromes 3, 15, 975, 64575 (3, 33, 33033, 3330333 in base 4) and at 20966400 joins the trajectory of 318 = A075421(2) and the trajectories of 1 (A035524) and 2 do not contain exactly four palindromes.
		

Crossrefs

Showing 1-6 of 6 results.