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.

Previous Showing 11-16 of 16 results.

A121167 a(1)=1; a(n) = the reversal of (a(n-1) + spd(a(n-1))), where spd(n) is the sum of d^d for d the digits of n (with 0^0 = 1).

Original entry on oeis.org

1, 2, 6, 26664, 298661, 386985404, 646010808, 218856976, 288157046, 460585223, 736514774, 427530937, 259106618, 767004366, 507197867, 489519319, 2141658661, 3329758512, 3706874373, 2129616273, 8563597152, 3644768698, 9667076604
Offset: 1

Views

Author

Jason Earls, Aug 14 2006

Keywords

Comments

Eventually periodic with period 7978, as a(23895) = a(31873) = 3365361711. - Robert Israel, Oct 13 2024

Crossrefs

Cf. A045503 (spd).

Programs

  • Maple
    f(0):= 1: for i from 1 to 9 do f(i):= i^i od:
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    R:= 1: x:= 1:
    for n from 1 to 25 do
      x:= rev(x + convert(map(f, convert(x,base,10)),`+`));
      R:= R,x
    od:
    R; # Robert Israel, Oct 13 2024
  • Mathematica
    s={1};fn[n_]:=If[n>0,n^n,1]; Do[AppendTo[s,IntegerReverse[Total[fn/@IntegerDigits[s[[-1]]]]+s[[-1]]]],{n,22}];s (* James C. McMahon, Oct 13 2024 *)

Extensions

Name clarified by Robert Israel, Oct 13 2024

A226036 Let abc... be the decimal expansion of n. a(n) is the number of iterations of the map n -> f(n) needed to reach the last number of the cycle, where f(n) = a^a + b^b + c^c + ...

Original entry on oeis.org

1, 0, 58, 66, 57, 104, 46, 70, 144, 98, 59, 59, 105, 70, 66, 107, 102, 46, 150, 124, 105, 105, 145, 71, 146, 47, 145, 65, 69, 115, 70, 70, 71, 152, 142, 104, 106, 106, 103, 44, 66, 66, 146, 142, 189, 151, 50, 62, 141, 101, 107, 107, 47, 104, 151, 102, 186, 76
Offset: 0

Views

Author

Michel Lagneau, May 24 2013

Keywords

Comments

Additive persistence with powers of decimal digits: number of steps for "add digit(i) ^ digit(i)" operation to stabilize when started at n.
Or number of distinct values obtained by iterating n -> A045503(n).
We take 0^0 = 1.
It is conjectured that the trajectory for every number converges to a single number. The growth of a(n) is very slow; for example, a(457) = 211, a(10337) = 213, a(16669) = 214, ...

Examples

			a(0) = 1 because 0 -> 0^0 = 1 with 1 iteration;
a(1) = 0 because 1 -> 1^1 => 0 iteration;
a(354) = 4 because:
354 -> 3^3 + 5^5 + 4^4 = 3408;
3408 -> 3^3 + 4^4 + 0^0 + 8^8 = 16777500;
16777500 -> 1^1 + 6^6 + 7^7 + 7^7 + 7^7 + 5^5 + 0^0 + 0^0 = 2520413;
2520413 -> 2^2 + 5^5 + 2^2 + 0^0 + 4^4 + 1^1 + 3^3 = 3418 and
3418 is the last number of the cycle because 3418 -> 16777500 is already in the trajectory. We obtain 4 iterations: 354 -> 3408 -> 16777500 -> 2520413 -> 3418.
		

Crossrefs

Programs

  • Maple
    A000312:=proc(n)
        if n = 0 then 1;
        else add(d^d, d=convert(n, base, 10)) ;
        end if;
    end proc:
    A226036:= proc(n)
        local traj , c;
        traj := n ;
        c := [n] ;
        while true do
           traj := A000312(traj) ;
           if member(traj, c) then
           return nops(c)-1 ;
           end if;
           c := [op(c), traj] ;
        end do:
    end proc:
    seq(A226036(n), n=0..100) ;
  • Mathematica
    Unprotect[Power]; 0^0 = 1; Protect[Power]; f[n_] := (cnt++; id = IntegerDigits[n]; Total[id^id]); a[n_] := (cnt = 0; NestWhile[f, n, UnsameQ, All]; cnt-1); Table[a[n], {n, 0, 60}] (* Jean-François Alcover, May 24 2013 *)

A226135 Let abcd... be the decimal expansion of n. Number of iterations of the map n -> f(n) needed to reach a number < 10, where f(n) = a^b + c^d + ... which ends in an exponent or a base according as the number of digits is even or odd.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 5, 2, 21, 2, 1, 1, 1, 3, 2, 3, 6, 8, 19, 6, 1, 1, 2, 5, 21, 3, 4, 12, 17, 4, 1, 1, 3, 2, 3, 5, 4, 15, 4, 3, 1, 1, 7, 2, 4, 14, 16, 4, 16, 4, 1, 1, 5, 6, 3, 2, 5, 11, 13, 15, 1, 1, 5
Offset: 0

Views

Author

Michel Lagneau, May 27 2013

Keywords

Comments

Inspired by the sequence A133501 (Number of steps for "powertrain" operation to converge when started at n). It is conjectured that the trajectory for each number converges to a single number < 10.
The conjecture is true, since f(x) < x trivially holds for x > 10^10 and I have verified that for every 10 <= x <= 10^10 there is a k such that f^(k)(x) < x, where f^(k) denotes f applied k times. Both the conventions 0^0 = 1 and 0^0 = 0 have been taken into account. - Giovanni Resta, May 28 2013

Examples

			a(62) = 7 because:
62 -> 6^2 = 36;
36 -> 3^6 = 729;
729 -> 7^2 + 9^1 = 58;
58 -> 5^8 = 390625;
390625 -> 3^9 + 0^6 + 2^5 = 19715;
19715 -> 1^9 + 7^1 + 5^1 = 13;
13 -> 1^3 = 1;
62 -> 36 -> 729 -> 58 -> 390625 -> 19715 -> 13 -> 1 with 7 iterations.
		

Crossrefs

Programs

  • Maple
    A133501:= proc(n)
         local a, i, n1, n2, t1, t2;
         n1:=abs(n); n2:=sign(n); t1:=convert(n1, base, 10); t2:=nops(t1); a:=0;
            for i from 0 to floor(t2/2)-1 do
             a := a+t1[t2-2*i]^t1[t2-2*i-1];
           od:
           if t2 mod 2 = 1 then
           a:=a+t1[1]; fi; RETURN(n2*a); end;
    A226135:= proc(n)
        local traj , c;
        traj := n ;
        c := [n] ;
        while true do
           traj := A133501(traj) ;
           if member(traj, c) then
           return nops(c)-1 ;
           end if;
           c := [op(c), traj] ;
        end do:
    end proc:
    seq(A226135(n), n=0..100) ;
    # second Maple program:
    f:= n-> `if`(n<10, n, `if`(is(length(n), odd), f(10*n+1),
                   iquo(irem(n, 100, 'r'), 10, 'h')^h+f(r))):
    a:= n-> `if`(n<10, 0, 1+a(f(n))):
    seq(a(n), n=0..100);  # Alois P. Heinz, May 27 2013

A329527 The prime numbers that are prime-indexed primes and whose reversal, digit sum, sum of digits to their own power, adjacent digit sum concatenation, and adjacent digit difference concatenation are also primes.

Original entry on oeis.org

10180481, 11245547, 18486581, 35015063, 72042701, 72466367, 112823743, 113135621, 171199663, 304000381, 308486107, 318827167, 370257067, 382355443, 722948621, 731621629, 765348167, 771649421, 775786489, 776751581, 916132267, 963985829, 965521463, 980165701, 1002471581
Offset: 1

Views

Author

Scott R. Shannon, Jan 07 2020

Keywords

Comments

This sequence lists the prime numbers that are prime-indexed primes A006450, and whose digit reversal A004086, digit sum A007953, sum of digits to their own powers A045503, concatenation of adjacent digit sums A053392, and concatenation of adjacent digit differences A040115, are also primes. This is a subsequence of A006450 and A331031. Note that, as in A045503, we assume 0^0 = 1. There are only three entries for primes up to 20491057.

Examples

			a(1) = 10180481, as 10180481 is the 675797th prime, 10180481 in reversal is 18408101, 1+0+1+8+0+4+8+1=23, 1^1+0^0+1^1+8^8+0^0+4^4+8^8+1^1=33554693, '1+0'+'0+1'+'1+8'+'8+0'+'0+4'+'4+8'+'8+1'=11984129, '|1-0|'+'|0-1|'+'|1-8|'+'|8-0|'+'|0-4|'+'|4-8|'+'|8-1|'=1178447, and 10180481, 675797, 18408101, 23, 33554693, 11984129, 1178447 are all prime.
		

Crossrefs

Extensions

Terms a(4) and beyond from Giovanni Resta, Jan 08 2020

A334828 Numbers that divide the multiplication of its digits raised to their own powers.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 16, 25, 36, 64, 96, 125, 128, 135, 162, 175, 216, 250, 256, 375, 378, 384, 432, 486, 567, 576, 625, 648, 672, 675, 729, 735, 756, 768, 784, 864, 875, 972, 1024, 1176, 1250, 1296, 1372, 1715, 1764, 1944, 2048, 2304, 2500, 2744, 2916, 3087, 3125, 3375, 3456, 3645, 3675, 4096
Offset: 1

Views

Author

Scott R. Shannon, May 13 2020

Keywords

Comments

As in A045503 we take 0^0 = 1.
Numbers m that divide A061510(m).

Examples

			5 is a term as 5^5 = 3125 which is divisible by 5.
16 is a term as 1^1*6^6 = 46656 which is divisible by 16.
375 is a term as 3^3*7^7*5^5 = 69486440625 which is divisible by 375.
1176 is a term as 1^1*1^1*7^7*6^6 = 38423222208 which is divisible by 1176.
		

Crossrefs

Programs

  • Mathematica
    pow[n_] := If[n == 0, 1, n^n]; Select[Range[2^12], Divisible[Times @@ (pow /@ IntegerDigits[#]), #] &] (* Amiram Eldar, May 13 2020 *)
  • PARI
    isok(m) = my(d=digits(m)); (prod(k=1, #d, d[k]^d[k]) % m) == 0; \\ Michel Marcus, May 14 2020

A344658 a(n) = a^a - b^b + c^c - ... -+ d^d where the decimal expansion of n is abc...d.

Original entry on oeis.org

1, 1, 4, 27, 256, 3125, 46656, 823543, 16777216, 387420489, 0, 0, -3, -26, -255, -3124, -46655, -823542, -16777215, -387420488, 3, 3, 0, -23, -252, -3121, -46652, -823539, -16777212, -387420485, 26, 26, 23, 0, -229, -3098, -46629, -823516, -16777189, -387420462
Offset: 0

Views

Author

Massimo Corinaldesi, May 26 2021

Keywords

Comments

A045503 sums the corresponding powers of digits. This sequence alternates addition and subtraction of the powers of digits.

Crossrefs

Cf. A045503.

Programs

  • Mathematica
    pow[n_] := If[n == 0, 1, n^n]; a[n_] := Total[pow /@ (d = IntegerDigits[n])*(-1)^Range[0, Length[d] - 1]]; Array[a, 40, 0] (* Amiram Eldar, May 28 2021 *)
  • PARI
    a(n) = if(n, my(d=digits(n)); sum(k=1, #d, (-1)^(k+1)*d[k]^d[k]), 1) \\ Felix Fröhlich and Michel Marcus, May 26 + 31 2021
    
  • Python
    def a(n): return sum(d**d*(-1)**i for i, d in enumerate(map(int, str(n))))
    print([a(n) for n in range(40)]) # Michael S. Branicky, May 28 2021
  • newLISP
    (define (a n)
      (if (zero? n) 1
        (local (sign out power)
          (setq power '(1 1 4 27 256 3125 46656 823543 16777216 387420489))
          (setq out 0)
          (if (odd? (length n))
              (setq sign 1)
              (setq sign -1))
          (while (!= n 0)
            (setq out (+ out (* sign (power (% n 10)))))
            (setq sign (* sign -1))
            (setq n (/ n 10)))
          out)))
    
Previous Showing 11-16 of 16 results.