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-20 of 22 results. Next

A065883 Remove factors of 4 from n (i.e., write n in base 4, drop final zeros, then rewrite in decimal).

Original entry on oeis.org

1, 2, 3, 1, 5, 6, 7, 2, 9, 10, 11, 3, 13, 14, 15, 1, 17, 18, 19, 5, 21, 22, 23, 6, 25, 26, 27, 7, 29, 30, 31, 2, 33, 34, 35, 9, 37, 38, 39, 10, 41, 42, 43, 11, 45, 46, 47, 3, 49, 50, 51, 13, 53, 54, 55, 14, 57, 58, 59, 15, 61, 62, 63, 1, 65, 66, 67, 17, 69, 70, 71, 18, 73, 74, 75
Offset: 1

Views

Author

Henry Bottomley, Nov 26 2001

Keywords

Examples

			a(7)=7, a(14)=14, a(28)=a(4*7)=7, a(56)=a(4*14)=14, a(112)=a(4^2*7)=7.
		

Crossrefs

Cf. A214392, A235127, A350091 (drop final 2's).
Remove other factors: A000265, A038502, A132739, A244414, A242603, A004151.

Programs

  • Maple
    A065883:= n -> n/4^floor(padic:-ordp(n,2)/2):
    map(A065883, [$1..1000]); # Robert Israel, Dec 08 2015
  • Mathematica
    If[Divisible[#,4],#/4^IntegerExponent[#,4],#]&/@Range[80] (* Harvey P. Dale, Aug 31 2013 *)
  • PARI
    a(n)=n/4^valuation(n,4); \\ Joerg Arndt, Dec 09 2015
    
  • Python
    def A065883(n): return n>>((~n&n-1).bit_length()&-2) # Chai Wah Wu, Jul 09 2022

Formula

If n mod 4 = 0 then a(n) = a(n/4), otherwise a(n) = n.
Multiplicative with a(p^e) = 2^(e (mod 2)) if p = 2 and a(p^e) = p^e if p is an odd prime.
a(n) = n/4^A235127(n).
a(n) = A214392(n) if n mod 16 != 0. - Peter Kagey, Sep 02 2015
From Robert Israel, Dec 08 2015: (Start)
G.f.: x/(1-x)^2 - 3 Sum_{j>=1} x^(4^j)/(1-x^(4^j))^2.
G.f. satisfies G(x) = G(x^4) + x/(1-x)^2 - 4 x^4/(1-x^4)^2. (End)
Sum_{k=1..n} a(k) ~ (2/5) * n^2. - Amiram Eldar, Nov 20 2022
Dirichlet g.f.: zeta(s-1)*(4^s-4)/(4^s-1). - Amiram Eldar, Jan 04 2023

A100026 Consider all (2n+1)-digit palindromic primes of the form 10...0M0...01 (so that M is a palindrome with <= 2n-1 digits); a(n) = smallest such M.

Original entry on oeis.org

0, 3, 3, 3, 5, 8, 323, 5, 8, 212, 3, 161, 8, 3, 242, 3, 8, 10901, 737, 161, 242, 333, 282, 6, 252, 474, 5, 12921, 8, 131, 18381, 6, 444, 6, 797, 606, 717, 15351, 464, 333, 626, 545, 13031, 161, 747, 191, 323, 636, 32523, 303, 282, 888, 686, 18981, 111, 15951, 12021
Offset: 1

Views

Author

Harvey Dubner (harvey(AT)dubner.com), Nov 20 2004

Keywords

Comments

Is this the same as "Longest palindromic proper substring of A100027(n) or A028989(n+1) that occurs only once in the decimal representation of A100027(n) or A028989(n+1), respectively"? - Felix Fröhlich, Apr 30 2022
A more formal definition may be a(n) = A004151(A028989(n+1) - 10^(2n) - 1) with the convention that A004151(0) = 0. Only in the unlikely situation that A080176 contains undiscovered primes will a(n) = 0 occur for n > 1. - Jeppe Stig Nielsen, Apr 04 2025

Crossrefs

The corresponding palindromic primes are shown in A100027.

Programs

  • Mathematica
    f[n_] := Block[{k = 0, t = Flatten[Join[{1}, Table[0, {n - 1}]]]}, While[s = Drop[t, Min[ -Floor[ Log[10, k]/2], 0]]; k != FromDigits[ Reverse[ IntegerDigits[k]]] || !PrimeQ[ FromDigits[ Join[s, IntegerDigits[k], Reverse[s]]]], k++ ]; k]; Table[ f[n], {n, 56}] (* Robert G. Wilson v, Nov 22 2004 *)

Extensions

More terms from Robert G. Wilson v, Nov 22 2004

A062293 Smallest multiple k*n of n which has even digits and is a palindrome or becomes a palindrome when 0's are added on the left (e.g., 10 becomes 010, which is a palindrome).

Original entry on oeis.org

0, 2, 2, 6, 4, 20, 6, 686, 8, 666, 20, 22, 60, 2002, 686, 60, 80, 646, 666, 646, 20, 6006, 22, 828, 600, 200, 2002, 8886888, 868, 464, 60, 868, 800, 66, 646, 6860, 828, 222, 646, 6006, 40, 22222, 6006, 68886, 44, 6660, 828, 282, 4224, 686, 200, 42024, 4004, 424, 8886888, 220, 8008, 68286, 464, 68086, 60
Offset: 0

Views

Author

Amarnath Murthy, Jun 18 2001

Keywords

Comments

Every integer n has a multiple of the form 99...9900...00. To see that n has a multiple that's a palindrome (allowing 0's on the left) with even digits, let 9n divide 99...9900...00; then n divides 22...2200...00. - Dean Hickerson, Jun 29 2001

Examples

			a(7) = 686 as 686 = 98*7 is the smallest palindrome multiple of 7 with even digits.
		

Crossrefs

Cf. A062279. Values of k are given in A061797.

Programs

  • ARIBAS
    stop := 500000; for n := 0 to 60 do k := 1; test := true; while test and k < stop do m := omit_trailzeros(n*k); if test := not all_even(m) or m <> int_reverse(m) then inc(k); end; end; if k < stop then write(n*k," "); else write(-1," "); end; end;
    
  • Haskell
    a062293 0 = 0
    a062293 n = head [x | x <- map (* n) [1..],
                     all (`elem` "02468") $ show x, a136522 (a004151 x) == 1]
    -- Reinhard Zumkeller, Feb 01 2012

Extensions

Corrected and extended by Klaus Brockhaus, Jun 21 2001

A348853 Delete any least significant 0's from the Zeckendorf representation of n, leaving its "odd" part.

Original entry on oeis.org

1, 1, 1, 4, 1, 6, 4, 1, 9, 6, 4, 12, 1, 14, 9, 6, 17, 4, 19, 12, 1, 22, 14, 9, 25, 6, 27, 17, 4, 30, 19, 12, 33, 1, 35, 22, 14, 38, 9, 40, 25, 6, 43, 27, 17, 46, 4, 48, 30, 19, 51, 12, 53, 33, 1, 56, 35, 22, 59, 14, 61, 38, 9, 64, 40, 25, 67, 6, 69, 43, 27, 72
Offset: 1

Views

Author

Kevin Ryde, Nov 14 2021

Keywords

Comments

Terms are odd Zeckendorfs A003622 and the fixed points are where n is odd already so that a(n) = n iff n is in A003622.
A139764(n) is the least significant "10..00" part of n so Zeckendorf multiplication n = A101646(a(n), A139764(n)).
The equivalent delete least significant 0's in binary is A000265 so that conversion to Fibbinary (A003714) and back gives a(n) = A022290(A000265(A003714(n))).
a(n) = 1 iff n is a Fibonacci number >= 1 (A000045) since they are Zeckendorf 100..00.
a(n) = 4 iff n is a Lucas number >= 4 (A000032) since they are Zeckendorf 10100..00 which reduces to 101.
In the Wythoff array A035513, a(n) is the term in column 0 of the row containing n, and hence the formula below using row number A019586 to select which of the odds (column 0) is a(n).

Examples

			n    = 81 = Zeckendorf 101001000.
a(n) = 19 = Zeckendorf 101001.
		

Crossrefs

Cf. A189920 (Zeckendorf digits), A003622 (odds), A003849 (final digit), A005206, A319433 (shift down).
Cf. A000045 (Fibonacci), A000032 (Lucas).
Cf. A035513 (Wythoff array), A019586 (row number).
Cf. A003714 (Fibbinary), A022290 (its inverse).
In other bases: A000265 (binary), A004151 (decimal).

Programs

  • PARI
    my(phi=quadgen(5)); a(n) = my(q,r); while([q,r]=divrem(n+2,phi); r<1, n=q-1); n;

Formula

a(n) = n if A003849(n)=1, otherwise a(n) = a(A005206(n)) = a(A319433(n)).
a(n) = A003622(A019586(n) + 1).
Sum_{k=1..n} a(k) ~ n^2/(2*phi), where phi is the golden ratio (A001622). - Amiram Eldar, Feb 17 2024

A062279 Smallest multiple k*n of n which is a palindrome or becomes a palindrome when 0's are added on the left (e.g. 10 becomes 010 which is a palindrome).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 60, 494, 70, 30, 80, 272, 90, 171, 20, 252, 22, 161, 600, 50, 494, 999, 252, 232, 30, 434, 800, 33, 272, 70, 252, 111, 494, 585, 40, 656, 252, 989, 44, 90, 414, 141, 2112, 343, 50, 969, 676, 212, 9990, 55, 616, 171, 232, 767
Offset: 0

Views

Author

Amarnath Murthy, Jun 17 2001

Keywords

Comments

Every positive integer is a factor of a palindrome, unless it is a multiple of 10 (D. G. Radcliffe, see Links).

Examples

			a(13) = 494 is the smallest multiple of 13 which is a palindrome.
		

Crossrefs

Cf. A050782, A062293. Values of k are given in A061674.
Cf. A141709.

Programs

  • ARIBAS
    : maxarg := 60; stop := 200000; for n := 0 to maxarg do k := 1; test := true; while test and k < stop do m := omit_trailzeros(n*k); if test := m <> int_reverse(m) then inc(k); end; end; if k < stop then write(n*k," "); else write(-1," "); end; end;
    
  • Haskell
    a062279 0 = 0
    a062279 n = until ((== 1) . a136522 . a004151) (+ n) n
    -- Reinhard Zumkeller, May 06 2013

Formula

A136522(A004151(a(n))) = 1. - Reinhard Zumkeller, May 06 2013

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org) and Klaus Brockhaus, Jun 18 2001

A061674 Smallest k such that k*n is a palindrome or becomes a palindrome when 0's are added on the left.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 38, 5, 2, 5, 16, 5, 9, 1, 12, 1, 7, 25, 2, 19, 37, 9, 8, 1, 14, 25, 1, 8, 2, 7, 3, 13, 15, 1, 16, 6, 23, 1, 2, 9, 3, 44, 7, 1, 19, 13, 4, 185, 1, 11, 3, 4, 13, 1, 442, 7, 4, 33, 9, 1, 11, 4, 6, 1, 845, 35, 4, 3, 4, 65, 1, 11, 6, 1, 12345679, 8, 9, 3
Offset: 0

Views

Author

Amarnath Murthy, Jun 17 2001

Keywords

Comments

Every positive integer is a factor of a palindrome, unless it is a multiple of 10 (D. G. Radcliffe, see Links).

Examples

			a(12) = 5 since 5*12 = 60 (i.e. 060) is a palindrome.
		

Crossrefs

Cf. A050782, A062293. Values of k*n are given in A062279.

Programs

  • ARIBAS
    stop := 50000000; for n := 0 to 100 do k := 1; test := true; while test and k < stop do m := omit_trailzeros(n*k); if test := m <> int_reverse(m) then inc(k); end; end; if k < stop then write(k," "); else write(-1," "); end; end;
    
  • Haskell
    a061674 n = until ((== 1) . a136522 . a004151 . (* n)) (+ 1) 1
    -- Reinhard Zumkeller, Jul 20 2012
  • Mathematica
    rz[n_]:=Module[{idn=IntegerDigits[n]},While[Last[idn]==0,idn=Most[idn]];idn]; k[n_]:=Module[{k=1,p},p=k*n;While[rz[p]!=Reverse[rz[p]],k++;p=k*n];k]; Join[ {1},Array[k,90]] (* Harvey P. Dale, Mar 06 2013 *)

A251984 Smallest number such that a carry occurs when adding it to n in decimal representation.

Original entry on oeis.org

9, 8, 7, 6, 5, 4, 3, 2, 1, 90, 9, 8, 7, 6, 5, 4, 3, 2, 1, 80, 9, 8, 7, 6, 5, 4, 3, 2, 1, 70, 9, 8, 7, 6, 5, 4, 3, 2, 1, 60, 9, 8, 7, 6, 5, 4, 3, 2, 1, 50, 9, 8, 7, 6, 5, 4, 3, 2, 1, 40, 9, 8, 7, 6, 5, 4, 3, 2, 1, 30, 9, 8, 7, 6, 5, 4, 3, 2, 1, 20, 9, 8, 7, 6
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 12 2014

Keywords

Crossrefs

Programs

  • Haskell
    a251984 n = if d > 0 then 10 - d else 10 * a251984 n'
                where (n',d) = divMod n 10
    
  • Python
    def a(n):
        s = str(n)
        t = s.strip('0')
        return (10 - int(t)%10) * 10**(len(s) - len(t))
    print([a(n) for n in range(1, 85)]) # Michael S. Branicky, Sep 08 2021

Formula

a(n) = (10 - A004151(n) mod 10) * 10^A122840(n).

A061797 Smallest k such that k*n has even digits and is a palindrome or becomes a palindrome when 0's are added on the left.

Original entry on oeis.org

1, 2, 1, 2, 1, 4, 1, 98, 1, 74, 2, 2, 5, 154, 49, 4, 5, 38, 37, 34, 1, 286, 1, 36, 25, 8, 77, 329144, 31, 16, 2, 28, 25, 2, 19, 196, 23, 6, 17, 154, 1, 542, 143, 1602, 1, 148, 18, 6, 88, 14, 4, 824, 77, 8, 164572, 4, 143, 1198, 8, 1154, 1, 1126, 14, 962, 66, 308, 1, 998
Offset: 0

Views

Author

Amarnath Murthy, Jun 17 2001

Keywords

Comments

Every integer n has a multiple of the form 99...9900...00. To see that n has a multiple that's a palindrome (allowing 0's on the left) with even digits, let 9n divide 99...9900...00; then n divides 22...2200...00. - Dean Hickerson, Jun 29 2001
a(81), if it exists, is greater than 5 million. - Harvey P. Dale, Dec 19 2021
A palindrome is divisible by 81 iff its sum of digits is divisible by 81. Thus a(81) = 688888888628888888886 / 81 = 8504801097146776406, as 688888888868888888886 is the least palindrome with even digits and sum of digits 162. - Robert Israel, Apr 17 2025

Examples

			a(12) = 5 since 5*12 = 60 (i.e., "060") is a palindrome.
		

Crossrefs

Cf. A050782, A062293 A061674. Values of k*n are given in A062293.

Programs

  • ARIBAS
    stop := 500000; for n := 0 to 75 do k := 1; test := true; while test and k < stop do m := omit_trailzeros(n*k); if test := not all_even(m) or m <> int_reverse(m) then inc(k); end; end; if k < stop then write(k," "); else write(-1," "); end; end;
    
  • Haskell
    a061797 0 = 1
    a061797 n = head [k | k <- [1..], let x = k * n,
                     all (`elem` "02468") $ show x, a136522 (a004151 x) == 1]
    -- Reinhard Zumkeller, Feb 01 2012
  • Maple
    epali:= proc(x,d) local L,i;
      L:= convert(x,base,5);
      if d::even then 2*add(L[-i]*(10^(i-1)+10^(d-i)),i=1..d/2)
      else 2*(L[-(d+1)/2]*10^((d-1)/2) + add(L[-i]*(10^(i-1)+10^(d-i)),i=1..(d-1)/2))
      fi
    end proc;
    Agenda:= {$0..80}:
    count:= 0:
    for d from 1 while count < 81 do
      E[d]:= [seq(epali(i,d),i=5^(ceil(d/2)-1) .. 5^ceil(d/2)-1)];
      P:= sort([op(E[d]),seq(op(E[k] *~ 10^(d-k)), k=1..d-1)]);
      for x in P do
        Q:= select(t -> x mod t = 0, Agenda);
        if Q <> {} then
          count:= count + nops(Q);
          for q in Q do R[q]:= x/q od;
          Agenda:= Agenda minus Q;
        fi;
      od;
    od:
    seq(R[i],i=0..80); # Robert Israel, Apr 18 2025
  • Mathematica
    a[n_] := For[k = 1, True, k++, id = IntegerDigits[k*n]; If[AllTrue[id, EvenQ], rid = Reverse[id]; If[id == rid || (id //. {d__, 0} :> {d}) == (rid //. {0, d__} :> {d}), Return[k]]]]; a[0] = 1; Table[a[n], {n, 0, 70}] (* Jean-François Alcover, Apr 01 2016 *)
    skpal[n_]:=Module[{k=1},While[Count[IntegerDigits[k n],?OddQ]>0 || (!PalindromeQ[(k n)/10^IntegerExponent[n k]]),k++];k]; Array[skpal,70,0] (* _Harvey P. Dale, Dec 19 2021 *)

Extensions

More terms from Klaus Brockhaus, Jun 27 2001

A110795 Least multiple of n! that leaves a palindrome if trailing zeros are ignored.

Original entry on oeis.org

1, 2, 6, 600, 600, 25200, 25200, 483840, 698867688960, 6988676889600, 293599799539200, 489718781798400, 48196817186918400, 4091568555865190400, 84446094349064448000, 2308054967694508032000, 4070651384548315607040000, 46671804001710040817664000, 46671804001710040817664000
Offset: 1

Views

Author

Amarnath Murthy, Aug 13 2005

Keywords

Examples

			a(8) = 483840 = 8!*12, ignoring the trailing zero gives 48384 which is a palindrome.
		

Crossrefs

Cf. A110796.

Programs

  • Maple
    A004151 := proc(n) local a ; a := n ; while a mod 10 = 0 do a := a/10 ; end: RETURN(a); end: isA002113 := proc(n) local digs,i ; digs := convert(n,base,10) ; for i from 1 to nops(digs)/2 do if op(i,digs) <> op(-i,digs) then RETURN(false) ; fi ; od; RETURN(true) ; end: A110795 := proc(n) local nf,k ; nf := n! ; k := 1 ; while not isA002113(A004151(k*nf)) do k := k+1 ; od: RETURN(k*nf) ; end: seq(A110795(n),n=1..9) ; # R. J. Mathar, Aug 17 2007

Extensions

Corrected and extended by R. J. Mathar, Aug 17 2007
a(11)-a(13) from Donovan Johnson, Nov 15 2009
a(14)-a(16) from Donovan Johnson, Feb 01 2011
Terms a(17) onward from Max Alekseyev, Feb 06 2024

A382184 a(n) is the least k >= 0 such that the factorial base expansion of n starts with that of k while the remaining digits are zeros.

Original entry on oeis.org

0, 1, 1, 3, 4, 5, 1, 7, 3, 9, 10, 11, 4, 13, 5, 15, 16, 17, 18, 19, 20, 21, 22, 23, 1, 25, 7, 27, 28, 29, 3, 31, 9, 33, 34, 35, 10, 37, 11, 39, 40, 41, 42, 43, 44, 45, 46, 47, 4, 49, 13, 51, 52, 53, 5, 55, 15, 57, 58, 59, 16, 61, 17, 63, 64, 65, 66, 67, 68, 69
Offset: 0

Views

Author

Rémy Sigrist, Mar 17 2025

Keywords

Examples

			The first terms, in decimal and in factorial base, are:
  n   a(n)  fact(n)  fact(a(n))
  --  ----  -------  ----------
   0     0  0        0
   1     1  1        1
   2     1  1,0      1
   3     3  1,1      1,1
   4     4  2,0      2,0
   5     5  2,1      2,1
   6     1  1,0,0    1
   7     7  1,0,1    1,0,1
   8     3  1,1,0    1,1
   9     9  1,1,1    1,1,1
  10    10  1,2,0    1,2,0
  11    11  1,2,1    1,2,1
  12     4  2,0,0    2,0
  13    13  2,0,1    2,0,1
  14     5  2,1,0    2,1
  15    15  2,1,1    2,1,1
		

Crossrefs

Programs

  • PARI
    a(n) = { if (n, my (m = n, s = oo, d); for (r = 2, oo, if (m==0 || s==0, break, d = m%r, s = min(s, r-1-d);); m \= r;); if (s, my (v = 0); for (r = 2, oo, if (n==0, return (v), v += (n%r) * max(0, r-1-s)!; n \= r;);););); return (n); }

Formula

a(n) <= n with equality iff n = 0 or n belongs to A273670.
a(k!) = 1 for any k >= 0.
Previous Showing 11-20 of 22 results. Next