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-15 of 15 results.

A059717 Start with decimal expansion of n; if all digits have the same parity, stop; otherwise write down the number formed by the even digits and the number formed by the odd digits and add them; repeat.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 3, 13, 5, 15, 7, 17, 9, 19, 20, 3, 22, 5, 24, 7, 26, 9, 28, 11, 3, 31, 5, 33, 7, 35, 9, 37, 11, 39, 40, 5, 42, 7, 44, 9, 46, 11, 48, 13, 5, 51, 7, 53, 9, 55, 11, 57, 13, 59, 60, 7, 62, 9, 64, 11, 66, 13, 68, 15, 7, 71, 9, 73, 11, 75
Offset: 0

Views

Author

N. J. A. Sloane, Feb 08 2001

Keywords

Comments

a(A011557(n)) = 1; a(A059708(n)) = A059708(n). [Reinhard Zumkeller, Jul 05 2011]

Examples

			For example, 59708 -> (0)8 + 597 = 605 -> 60 + 5 = 65 -> 6 + 5 = 11, stop, so a(59708) = 11.
		

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr)
    a059717 n = if u == n || v == n then n else a059717 (u + v) where
       (u,v) = foldl (\(x,y) d -> if odd d then (10*x+d,y) else (x,10*y+d))
            (0,0) $ reverse $ unfoldr
            (\z -> if z == 0 then Nothing else Just $ swap $ divMod z 10) n
    -- Reinhard Zumkeller, Nov 16 2011 (corrected), Jul 05 2011
  • Mathematica
    f[n_] := (id = IntegerDigits[n]; oddDigits = Select[id, OddQ]; evenDigits = Select[id, EvenQ]; Which[ oddDigits == {}, FromDigits[ evenDigits ], evenDigits == {}, FromDigits[ oddDigits ], True, FromDigits[ evenDigits ] + FromDigits[ oddDigits ]]); a[n_] := FixedPoint[f, n]; Table[a[n], {n, 0, 75}] (* Jean-François Alcover, May 31 2013 *)

A228709 Numbers having in decimal representation at least one pair of consecutive digits with the same parity.

Original entry on oeis.org

11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 40, 42, 44, 46, 48, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 86, 88, 91, 93, 95, 97, 99, 100, 102, 104, 106, 108, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 31 2013

Keywords

Crossrefs

Cf. A030141 (complement), A228710, A228722, A228723.
Cf. subsequences: A059708, A010785 (apart from first 10 terms).

Programs

  • Haskell
    a228709 n = a228709_list !! (n-1)
    a228709_list = filter ((== 0) . a228710) [0..]

Formula

A228710(a(n)) = 0.

A059707 If all digits have the same parity, stop; otherwise write down the number formed by the even digits and the number formed by the odd digits and multiply them; repeat.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 2, 13, 4, 15, 6, 17, 8, 19, 20, 2, 22, 6, 24, 0, 26, 4, 28, 8, 0, 31, 6, 33, 2, 35, 8, 37, 24, 39, 40, 4, 42, 2, 44, 20, 46, 28, 48, 8, 0, 51, 0, 53, 20, 55, 0, 57, 40, 59, 60, 6, 62, 8, 64, 0, 66, 42, 68, 20, 0, 71, 4, 73, 28, 75, 42
Offset: 0

Views

Author

N. J. A. Sloane, Feb 07 2001

Keywords

Comments

a(A059708(n)) = A059708(n). - Reinhard Zumkeller, Jun 15 2012

Examples

			89 -> 8*9 = 72 -> 7*2 = 14 -> 1*4 = 4, stop, so a(89) = 4.
33278 -> 28*337 = 9436 -> 46*93 = 4278 -> 42*78 -> 2996 -> 26*99 = 2574 -> 24*57 = 1368 -> 68*13 = 884, stop, so a(33278) = 884.
		

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr)
    a059707 n = if u == n || v == n then n else a059707 (u * v) where
       (u,v) = foldl (\(x,y) d -> if odd d then (10*x+d,y) else (x,10*y+d))
            (0,0) $ reverse $ unfoldr
            (\z -> if z == 0 then Nothing else Just $ swap $ divMod z 10) n
    -- Reinhard Zumkeller, Jun 15 2012
  • Mathematica
    f[n_] := (id = IntegerDigits[n]; oddDigits = Select[id, OddQ]; evenDigits = Select[id, EvenQ]; Which[oddDigits == {}, FromDigits[evenDigits], evenDigits == {}, FromDigits[oddDigits], True, FromDigits[evenDigits] * FromDigits[oddDigits]]); a[n_] := FixedPoint[f, n]; Table[a[n], {n, 0, 76}] (* Jean-François Alcover, May 16 2013 *)
    sp[n_]:=Module[{idn=IntegerDigits[n],e,o},e=Select[idn,EvenQ];o= Select[ idn,OddQ];If[Min[Length[o],Length[e]]>0,FromDigits[o] FromDigits[e], n]]; Table[FixedPoint[sp,i],{i,0,80}] (* Harvey P. Dale, Jun 05 2014 *)

Extensions

a(50) corrected by Reinhard Zumkeller, Jun 15 2012

A374097 a(n) = A196563(n)*A196564(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 0

Views

Author

Paolo Xausa, Jun 28 2024

Keywords

Comments

More than the usual number of terms are shown in order to distinguish this sequence from A180160, from which it first differs at n = 100.

Crossrefs

Cf. A055642, A059708 (positions of zeros), A180160, A196563, A196564.

Programs

  • Mathematica
    A374097[n_] := #*(IntegerLength[n] - #) & [Total[Mod[IntegerDigits[n], 2]]];
    Array[A374097, 120, 0]

A306520 Numbers k with property that the arithmetic mean of any subset of its digits is an integer.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 40, 42, 44, 46, 48, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 86, 88, 91, 93, 95, 97, 99, 111, 117, 135, 153, 159, 171, 177, 195
Offset: 1

Views

Author

R. J. Cano, Feb 21 2019

Keywords

Comments

This sequence is different from A061383. Here digits in k must have all the same parity, otherwise the average of at least a pair of digits wouldn't be an integer. Note that for every 2-digit term in A061383 both digits have the same parity. But not every number whose digits have all the same parity (sequence A059708) belongs here.

Examples

			17 is in this sequence because the set of digits (1,7) has an integer average: 4.
159 and 195 are in this sequence because the sets of digits (1,5), (1,9), (5,9), and (1,5,9) all have integer averages, respectively: 3, 5, 7, and 5.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,200],AllTrue[Mean/@Subsets[IntegerDigits[#],{2, IntegerLength[ #]}],IntegerQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 09 2020 *)
  • PARI
    firstTerms_vec(n)={my(v=vector(n),c,t,w:list,h);for(i=1,+oo,w=List();forsubset(i,k,listput(w,k));listpop(w,1);forvec(j=vector(i,z,[(z==1)&&(i>1),9]),h=j[1]%2;for(l=2,#j,if((j[l]%2)!=h,next(2)));for(k=1,#w,t=vecextract(j,w[k]);if(vecsum(t)%(#w[k]),next(2)));v[c++]=fromdigits(j);if(c==n,return(v))))}
    
  • PARI
    isok(m,{B=10})={my(w=digits(m,B));forsubset(#w,y,if(y!=Vecsmall([]),if(vecsum(vecextract(w,y))%(#y),return(0)),next));1}

Formula

Apparently a(158+n) = A010785(35+n).
Previous Showing 11-15 of 15 results.